Skip to content

Commit

Permalink
Avoid double booking
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed Nov 2, 2023
1 parent c142143 commit 51438c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/admin/models/Reservations_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,8 @@ public function getNextBookableTable()
->with(['dining_section'])
->withCount(['reservations' => function ($query) {
$query->where('reserve_date', $this->reserve_date)
->where('status_id', setting('confirmed_reservation_status'));
->whereNotIn('status_id', [0, setting('canceled_reservation_status')])
->orWhereNull('status_id');
}])
->reservable([
'locationId' => $this->location_id,
Expand Down

0 comments on commit 51438c4

Please sign in to comment.