diff --git a/backend/services/wallet-service/src/application/services/wallet-application.service.ts b/backend/services/wallet-service/src/application/services/wallet-application.service.ts index cdac58b3..aa36df36 100644 --- a/backend/services/wallet-service/src/application/services/wallet-application.service.ts +++ b/backend/services/wallet-service/src/application/services/wallet-application.service.ts @@ -3012,25 +3012,7 @@ export class WalletApplicationService { : 0; const totalCount = aggregateResult._count.id || 0; - // 查询按月统计 - const monthlyStats = await this.prisma.$queryRaw>` - SELECT - TO_CHAR(created_at, 'YYYY-MM') as month, - SUM(deducted_amount) as amount, - COUNT(*) as count - FROM offline_settlement_deductions - ${params.startDate ? this.prisma.$queryRaw`WHERE created_at >= ${params.startDate}` : this.prisma.$queryRaw``} - ${params.endDate ? this.prisma.$queryRaw`AND created_at <= ${params.endDate}` : this.prisma.$queryRaw``} - GROUP BY TO_CHAR(created_at, 'YYYY-MM') - ORDER BY month DESC - LIMIT 12 - `; - - // 简化查询:不使用条件拼接 + // 查询按月统计(简化版本,不使用日期筛选) const byMonth = await this.prisma.$queryRaw