mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +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
|
## License
|
||||||
|
|
||||||
Distributed under the MIT License. See `LICENSE.md` for more information.
|
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(`
|
bs.db.Raw(`
|
||||||
select bookings.id, customer_name, "from", "to", platform, sum(price * quantity) as total, canceled
|
select bookings.id, customer_name, "from", "to", platform, sum(price * quantity) as total, canceled
|
||||||
from bookings
|
from bookings
|
||||||
join items on bookings.id = items.booking_id
|
left join items on bookings.id = items.booking_id
|
||||||
group by bookings.id
|
group by bookings.id
|
||||||
order by id desc;
|
order by id desc;
|
||||||
`).
|
`).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue