fix: stats

This commit is contained in:
Rogee
2025-05-06 18:43:07 +08:00
parent 3387fb6cff
commit 463df5d3a9
4 changed files with 19 additions and 4 deletions

View File

@@ -227,7 +227,7 @@ func (m *ordersModel) Count(ctx context.Context, cond BoolExpression) (int64, er
func (m *ordersModel) SumAmount(ctx context.Context) (int64, error) {
tbl := table.Orders
stmt := SELECT(SUM(tbl.Price).AS("cnt")).FROM(tbl).WHERE(
tbl.Status.EQ(Int(int64(fields.OrderStatusPaid))),
tbl.Status.EQ(Int(int64(fields.OrderStatusCompleted))),
)
m.log.Infof("sql: %s", stmt.DebugSql())