Merge branch 'master-fix' of gitlab.com:jankstudio/resq into 612-rider-revamp
This commit is contained in:
commit
0a6985f6b0
1 changed files with 68 additions and 12 deletions
|
|
@ -2228,8 +2228,31 @@ class APIController extends Controller implements LoggedController
|
||||||
$long = $req->query->get('longitude');
|
$long = $req->query->get('longitude');
|
||||||
$lat = $req->query->get('latitude');
|
$lat = $req->query->get('latitude');
|
||||||
|
|
||||||
|
// NOTE: had to add this for promo tag
|
||||||
|
$cust = $this->session->getCustomer();
|
||||||
|
if ($cust == null)
|
||||||
|
{
|
||||||
|
$res->setError(true)
|
||||||
|
->setErrorMessage('No customer information found');
|
||||||
|
return $res->getReturnResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
$is_covered = false;
|
||||||
|
// check if customer still has promo
|
||||||
|
if (($cust->getCustomerTag('TAG_CAR_CLUB_OFFICER_PROMO')) ||
|
||||||
|
($cust->getCustomerTag('TAG_CAR_CLUB_MEMBER_PROMO')))
|
||||||
|
{
|
||||||
|
// if has customer tag, customer has not availed of promo
|
||||||
|
$is_covered = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// geofence
|
// geofence
|
||||||
$is_covered = $geo->isCovered($long, $lat);
|
$is_covered = $geo->isCovered($long, $lat);
|
||||||
|
}
|
||||||
|
|
||||||
|
// geofence
|
||||||
|
// $is_covered = $geo->isCovered($long, $lat);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'longitude' => $long,
|
'longitude' => $long,
|
||||||
|
|
@ -2577,6 +2600,17 @@ class APIController extends Controller implements LoggedController
|
||||||
$hub = $car_club_cust_hub->getHub();
|
$hub = $car_club_cust_hub->getHub();
|
||||||
$nearest_hub_slots = $this->findAdvanceNearestHubAndSlots($coordinates, $em, $map_tools, $hub);
|
$nearest_hub_slots = $this->findAdvanceNearestHubAndSlots($coordinates, $em, $map_tools, $hub);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$nearest_hub_slots = $this->findAdvanceNearestHubAndSlots($coordinates, $em, $map_tools);
|
||||||
|
|
||||||
|
if (empty($nearest_hub_slots['hub']))
|
||||||
|
{
|
||||||
|
$res->setError(true)
|
||||||
|
->setErrorMessage('Thank you for reaching out to us. Due to the General Community Quarantine, our Operations are from 8AM to 6PM only. Please expect a call from us tomorrow and we will assist you with your request. Thank you and stay safe!');
|
||||||
|
return $res->getReturnResponse();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -2636,8 +2670,30 @@ class APIController extends Controller implements LoggedController
|
||||||
$long = $req->request->get('long');
|
$long = $req->request->get('long');
|
||||||
$lat = $req->request->get('lat');
|
$lat = $req->request->get('lat');
|
||||||
|
|
||||||
|
// NOTE: had to move this up so we can check for promo before geofence
|
||||||
|
// customer
|
||||||
|
$cust = $this->session->getCustomer();
|
||||||
|
if ($cust == null)
|
||||||
|
{
|
||||||
|
$res->setError(true)
|
||||||
|
->setErrorMessage('No customer information found');
|
||||||
|
return $res->getReturnResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
$is_covered = false;
|
||||||
|
// check if customer still has promo
|
||||||
|
if (($cust->getCustomerTag('TAG_CAR_CLUB_OFFICER_PROMO')) ||
|
||||||
|
($cust->getCustomerTag('TAG_CAR_CLUB_MEMBER_PROMO')))
|
||||||
|
{
|
||||||
|
// if has customer tag, customer has not availed of promo
|
||||||
|
$is_covered = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
// geofence
|
// geofence
|
||||||
$is_covered = $geo->isCovered($long, $lat);
|
$is_covered = $geo->isCovered($long, $lat);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$is_covered)
|
if (!$is_covered)
|
||||||
{
|
{
|
||||||
// TODO: put geofence error message in config file somewhere
|
// TODO: put geofence error message in config file somewhere
|
||||||
|
|
@ -2690,13 +2746,13 @@ class APIController extends Controller implements LoggedController
|
||||||
->setStatusAutoAssign(AutoAssignStatus::NOT_ASSIGNED);
|
->setStatusAutoAssign(AutoAssignStatus::NOT_ASSIGNED);
|
||||||
|
|
||||||
// customer
|
// customer
|
||||||
$cust = $this->session->getCustomer();
|
// $cust = $this->session->getCustomer();
|
||||||
if ($cust == null)
|
// if ($cust == null)
|
||||||
{
|
// {
|
||||||
$res->setError(true)
|
// $res->setError(true)
|
||||||
->setErrorMessage('No customer information found');
|
// ->setErrorMessage('No customer information found');
|
||||||
return $res->getReturnResponse();
|
// return $res->getReturnResponse();
|
||||||
}
|
// }
|
||||||
$jo->setCustomer($cust);
|
$jo->setCustomer($cust);
|
||||||
|
|
||||||
// validate service type
|
// validate service type
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue