修改分账日志列表排序

This commit is contained in:
凌尛 2026-07-01 09:33:24 +08:00
parent b02fe84356
commit 125fd8e0f8

View File

@ -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("查询分账扣钱日志汇总失败")
}