mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
fix booking overview query
This commit is contained in:
parent
322f440716
commit
788711e8c9
1 changed files with 1 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ func NewService(db *gorm.DB) *Service {
|
||||||
func (bs Service) All() []*Line {
|
func (bs Service) All() []*Line {
|
||||||
bookings := make([]*Line, 0)
|
bookings := make([]*Line, 0)
|
||||||
bs.db.Raw(`
|
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
|
from bookings
|
||||||
join items on bookings.id = items.booking_id
|
join items on bookings.id = items.booking_id
|
||||||
group by bookings.id
|
group by bookings.id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue