Fix issues found while testing. #651
This commit is contained in:
parent
b7c5f5dafe
commit
457bbece2b
1 changed files with 10 additions and 6 deletions
|
|
@ -4326,6 +4326,7 @@ class APIController extends Controller implements LoggedController
|
||||||
}
|
}
|
||||||
|
|
||||||
$nearest = null;
|
$nearest = null;
|
||||||
|
$hub_slots = [];
|
||||||
$slot_found = false;
|
$slot_found = false;
|
||||||
// find the nearest hub
|
// find the nearest hub
|
||||||
if (!empty($nearest_hubs_with_distance))
|
if (!empty($nearest_hubs_with_distance))
|
||||||
|
|
@ -4349,17 +4350,17 @@ class APIController extends Controller implements LoggedController
|
||||||
if ($flag_hub_available == true)
|
if ($flag_hub_available == true)
|
||||||
{
|
{
|
||||||
$nearest = $nhd;
|
$nearest = $nhd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// temporarily set hub_data to nearest
|
// set hub data to what is in nearest
|
||||||
$hub_data = [
|
$hub_data = [
|
||||||
'hub' => $nhd['hub'],
|
'hub' => $nearest['hub'],
|
||||||
'slots' => $hub_slots['slot_data'],
|
'slots' => $hub_slots['slot_data'],
|
||||||
];
|
];
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $hub_data;
|
return $hub_data;
|
||||||
|
|
||||||
|
|
@ -4525,7 +4526,10 @@ class APIController extends Controller implements LoggedController
|
||||||
error_log('total rider slots ' . $total_rslots);
|
error_log('total rider slots ' . $total_rslots);
|
||||||
error_log('total unavailable slots ' . $total_unavailable_slots);
|
error_log('total unavailable slots ' . $total_unavailable_slots);
|
||||||
if ($total_rslots == $total_unavailable_rslots)
|
if ($total_rslots == $total_unavailable_rslots)
|
||||||
|
{
|
||||||
|
error_log('hub has no available slots');
|
||||||
$hub_available = false;
|
$hub_available = false;
|
||||||
|
}
|
||||||
|
|
||||||
$hs_data = [
|
$hs_data = [
|
||||||
'flag_hub_available' => $hub_unavailable,
|
'flag_hub_available' => $hub_unavailable,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue