use left join for bookings and items

This commit is contained in:
Ruidy 2024-06-28 17:03:23 +02:00
parent 69fdfa66af
commit 6bff5ccc18
No known key found for this signature in database
GPG key ID: E00F51288CB857CC
2 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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;
`).