Skip to content

Commit

Permalink
fix: query escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyTWF committed May 13, 2023
1 parent ef6747f commit 0a88bcb
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/Allocator/Stand/AbstractArrivalStandAllocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0a88bcb

Please sign in to comment.