Fix issues found while testing. #651
This commit is contained in:
parent
457bbece2b
commit
e80ce9db66
1 changed files with 10 additions and 1 deletions
|
|
@ -4336,7 +4336,16 @@ class APIController extends Controller implements LoggedController
|
|||
foreach ($nearest_hubs_with_distance as $nhd)
|
||||
{
|
||||
if (empty($nearest))
|
||||
{
|
||||
// get the slots for the hub to check if hub is available for assignment
|
||||
$hub_slots = $this->getHubRiderSlots($nhd['hub'], $em);
|
||||
|
||||
$flag_hub_available = $hub_slots['flag_hub_available'];
|
||||
if ($flag_hub_available == true)
|
||||
{
|
||||
$nearest = $nhd;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($nhd['distance'] < $nearest['distance'])
|
||||
|
|
|
|||
Loading…
Reference in a new issue