fix booking overview query

This commit is contained in:
Ruidy 2024-02-28 22:56:04 +01:00
parent 322f440716
commit 788711e8c9
No known key found for this signature in database
GPG key ID: E00F51288CB857CC

View file

@ -23,7 +23,7 @@ func NewService(db *gorm.DB) *Service {
func (bs Service) All() []*Line {
bookings := make([]*Line, 0)
bs.db.Raw(`
select bookings.id, customer_name, "from", "to", platform, sum(price) as total
select bookings.id, customer_name, "from", "to", platform, sum(price * quantity) as total
from bookings
join items on bookings.id = items.booking_id
group by bookings.id