We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi @shayan-yousefi !
The current implementation has a bug in the loading of endedReserves. Indeed, the current code
public function endedReserves(): MorphMany { return $this->reserves()->whereDate('end_reserve_date', '<', now())->orWhere(function ($query) { $query->whereDate('end_reserve_date', '=', now())->whereTime('end_reserve_time', '<=', now()); })->with(['customer', 'reservable']); }
produces the query
SELECT * FROM `reserves` WHERE `reserves`.`customer_type` = ? AND `reserves`.`customer_id` = ? AND `reserves`.`customer_id` IS NOT NULL AND Date(`end_reserve_date`) < ? OR ( Date(`end_reserve_date`) = ? AND Time(`end_reserve_time`) <= ? )
which is wrong (it loads today reserves with past time without regards of any other condition.
The correct query should be
SELECT * FROM `reserves` WHERE `reserves`.`customer_type` = ? AND `reserves`.`customer_id` = ? AND `reserves`.`customer_id` IS NOT NULL AND ( Date(`end_reserve_date`) < ? OR ( Date(`end_reserve_date`) = ? AND Time(`end_reserve_time`) <= ? ) )
I'm making a PR which solves the issue.
Thank you.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi @shayan-yousefi !
The current implementation has a bug in the loading of endedReserves. Indeed, the current code
produces the query
which is wrong (it loads today reserves with past time without regards of any other condition.
The correct query should be
I'm making a PR which solves the issue.
Thank you.
The text was updated successfully, but these errors were encountered: