diff --git a/app/Allocator/Stand/AbstractArrivalStandAllocator.php b/app/Allocator/Stand/AbstractArrivalStandAllocator.php index 71c3c0ac0..35efcb1e6 100644 --- a/app/Allocator/Stand/AbstractArrivalStandAllocator.php +++ b/app/Allocator/Stand/AbstractArrivalStandAllocator.php @@ -61,7 +61,16 @@ private function applyBaseOrderingToStandsQuery(Builder $query, NetworkAircraft // Prefer stands that haven't been requested by someone else $join->on('stands.id', '=', 'other_stand_requests.stand_id') ->on('other_stand_requests.user_id', '<>', $join->raw($aircraft->cid)) - ->on('other_stand_requests.requested_time', '>', $join->raw(Carbon::now())); + ->on( + 'other_stand_requests.requested_time', + '>', + $join->raw( + sprintf( + '\'%s\'', + Carbon::now() + ) + ) + ); }) ->orderByRaw('other_stand_requests.id IS NULL') ->inRandomOrder();