mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-06 02:36:49 +00:00
use left join for bookings and items
This commit is contained in:
parent
69fdfa66af
commit
6bff5ccc18
2 changed files with 5 additions and 1 deletions
|
|
@ -103,3 +103,7 @@ Don't forget to give the project a star! Thanks again!
|
|||
## License
|
||||
|
||||
Distributed under the MIT License. See `LICENSE.md` for more information.
|
||||
|
||||
## TODO
|
||||
|
||||
- [ ] other dates are not stored/parsed properly
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ func (bs Service) All() []*Line {
|
|||
bs.db.Raw(`
|
||||
select bookings.id, customer_name, "from", "to", platform, sum(price * quantity) as total, canceled
|
||||
from bookings
|
||||
join items on bookings.id = items.booking_id
|
||||
left join items on bookings.id = items.booking_id
|
||||
group by bookings.id
|
||||
order by id desc;
|
||||
`).
|
||||
|
|
|
|||
Loading…
Reference in a new issue