Deplete next rider slot for scheduled order if it overlaps #403
This commit is contained in:
parent
824f5c3423
commit
7abe34ee8b
1 changed files with 13 additions and 1 deletions
|
|
@ -3071,7 +3071,19 @@ class APIController extends Controller implements LoggedController
|
||||||
error_log("SLOT - $date_string - $slot_id");
|
error_log("SLOT - $date_string - $slot_id");
|
||||||
|
|
||||||
// decrement rider slot
|
// decrement rider slot
|
||||||
$hub_rider_slots[$date_string][$slot_id]--;
|
if (isset($hub_rider_slots[$date_string][$slot_id]))
|
||||||
|
$hub_rider_slots[$date_string][$slot_id]--;
|
||||||
|
|
||||||
|
// check if it goes through next slot (10 min allowance)
|
||||||
|
$mins = $date_sched->format('i');
|
||||||
|
if ($mins > 10)
|
||||||
|
{
|
||||||
|
$next_slot_id = sprintf('%02d_$02d', $hour + 1, $hour + 2);
|
||||||
|
// decrement rider slot
|
||||||
|
if (isset($hub_rider_slots[$date_string][$next_slot_id]))
|
||||||
|
$hub_rider_slots[$date_string][$next_slot_id]--;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
error_log(print_r($hub_rider_slots, true));
|
error_log(print_r($hub_rider_slots, true));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue