From 125fd8e0f884e969194e96816f3c9f145ce1048b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=87=8C=E5=B0=9B?= <1254210241@qq.com> Date: Wed, 1 Jul 2026 09:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E8=B4=A6=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/split_account_deduction_log.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/split_account_deduction_log.go b/service/split_account_deduction_log.go index 19d4f32..2f3c9c2 100644 --- a/service/split_account_deduction_log.go +++ b/service/split_account_deduction_log.go @@ -233,9 +233,9 @@ func (s *SplitAccountDeductionLogService) GetSplitAccountDeductionLogSummary(req FROM split_account_deduction_log WHERE created_by = ? GROUP BY business_no - ORDER BY business_no DESC + ORDER BY MIN(created_at) DESC LIMIT ? OFFSET ?` - fmt.Printf("[SQL] summary-data: WHERE created_by = '%s' GROUP BY business_no ORDER BY business_no DESC LIMIT %d OFFSET %d\n", createdBy, req.PageSize, offset) + fmt.Printf("[SQL] summary-data: WHERE created_by = '%s' GROUP BY business_no ORDER BY MIN(created_at) DESC LIMIT %d OFFSET %d\n", createdBy, req.PageSize, offset) if err := databaseConn.Raw(dataSQL, createdBy, req.PageSize, offset).Scan(&results).Error; err != nil { return nil, utils.NewError("查询分账扣钱日志汇总失败") } @@ -245,9 +245,9 @@ func (s *SplitAccountDeductionLogService) GetSplitAccountDeductionLogSummary(req MIN(created_at) AS created_at, MIN(updated_at) AS updated_at FROM split_account_deduction_log GROUP BY business_no - ORDER BY business_no DESC + ORDER BY MIN(created_at) DESC LIMIT ? OFFSET ?` - fmt.Printf("[SQL] summary-data: GROUP BY business_no ORDER BY business_no DESC LIMIT %d OFFSET %d\n", req.PageSize, offset) + fmt.Printf("[SQL] summary-data: GROUP BY business_no ORDER BY MIN(created_at) DESC LIMIT %d OFFSET %d\n", req.PageSize, offset) if err := databaseConn.Raw(dataSQL, req.PageSize, offset).Scan(&results).Error; err != nil { return nil, utils.NewError("查询分账扣钱日志汇总失败") }