Enable inventory and rider checks on hub criteria on user app and TAPI #800

This commit is contained in:
Ramon Gutierrez 2024-05-14 04:18:37 +08:00
parent a45c3dd65c
commit d52402a2ef
2 changed files with 8 additions and 0 deletions

View file

@ -752,6 +752,10 @@ class JobOrderController extends ApiController
$hub_criteria->setCustomerId($customer_id);
// set filter flags for inventory and available riders
$hub_criteria->setInventoryCheck();
$hub_criteria->setRidersCheck();
// find nearest hubs
$nearest_hubs = $hub_select->find($hub_criteria);

View file

@ -239,6 +239,10 @@ class JobOrderController extends ApiController
// find nearest hubs
$nearest_hubs = $hub_select->find($hub_criteria);
// set filter flags for inventory and available riders
$hub_criteria->setInventoryCheck();
$hub_criteria->setRidersCheck();
if (!empty($nearest_hubs))
{
// go through the hub list, find the nearest hub