From 788711e8c98965eccf54a2ed63c8099ed0db5291 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Wed, 28 Feb 2024 22:56:04 +0100 Subject: [PATCH] fix booking overview query --- internal/booking/service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/booking/service.go b/internal/booking/service.go index 1b401ce..c546810 100644 --- a/internal/booking/service.go +++ b/internal/booking/service.go @@ -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