update backend
This commit is contained in:
parent
b29677a192
commit
670a283c7b
@ -142,7 +142,7 @@ func (r *AnalyticsRepositoryImpl) GetProductAnalytics(ctx context.Context, organ
|
|||||||
|
|
||||||
err := query.
|
err := query.
|
||||||
Group("p.id, p.name, c.id, c.name").
|
Group("p.id, p.name, c.id, c.name").
|
||||||
Order("c.name ASC, revenue DESC").
|
Order("p.name ASC").
|
||||||
Limit(limit).
|
Limit(limit).
|
||||||
Scan(&results).Error
|
Scan(&results).Error
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ func (r *AnalyticsRepositoryImpl) GetProductAnalyticsPerCategory(ctx context.Con
|
|||||||
|
|
||||||
err := query.
|
err := query.
|
||||||
Group("c.id, c.name").
|
Group("c.id, c.name").
|
||||||
Order("total_revenue DESC").
|
Order("c.name ASC").
|
||||||
Scan(&results).Error
|
Scan(&results).Error
|
||||||
|
|
||||||
return results, err
|
return results, err
|
||||||
@ -353,7 +353,7 @@ func (r *AnalyticsRepositoryImpl) GetProfitLossAnalytics(ctx context.Context, or
|
|||||||
Where("oi.status != ?", entities.OrderItemStatusCancelled).
|
Where("oi.status != ?", entities.OrderItemStatusCancelled).
|
||||||
Where("o.created_at >= ? AND o.created_at <= ?", dateFrom, dateTo).
|
Where("o.created_at >= ? AND o.created_at <= ?", dateFrom, dateTo).
|
||||||
Group("p.id, p.name, c.id, c.name").
|
Group("p.id, p.name, c.id, c.name").
|
||||||
Order("c.name ASC, gross_profit DESC").
|
Order("p.name ASC").
|
||||||
Limit(1000)
|
Limit(1000)
|
||||||
|
|
||||||
if outletID != nil {
|
if outletID != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user