From fe8e9a9bb61787d29b5efee7dd384b9f64a577e8 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 6 Jan 2026 10:26:36 -0800 Subject: [PATCH] =?UTF-8?q?fix(planting-service):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E8=B6=8B=E5=8A=BF=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E8=A1=A8?= =?UTF-8?q?=E5=90=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 表名应为 planting_orders(复数),不是 planting_order 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../persistence/repositories/planting-order.repository.impl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/services/planting-service/src/infrastructure/persistence/repositories/planting-order.repository.impl.ts b/backend/services/planting-service/src/infrastructure/persistence/repositories/planting-order.repository.impl.ts index 9000839f..6022d44e 100644 --- a/backend/services/planting-service/src/infrastructure/persistence/repositories/planting-order.repository.impl.ts +++ b/backend/services/planting-service/src/infrastructure/persistence/repositories/planting-order.repository.impl.ts @@ -461,6 +461,7 @@ export class PlantingOrderRepositoryImpl implements IPlantingOrderRepository { } // 使用原生SQL进行分组查询 + // 注意:表名是 planting_orders(复数),参照 @@map("planting_orders") const results = await this.prisma.$queryRawUnsafe< Array<{ label: string; @@ -474,7 +475,7 @@ export class PlantingOrderRepositoryImpl implements IPlantingOrderRepository { COALESCE(SUM(tree_count), 0) as tree_count, COUNT(*) as order_count, COALESCE(SUM(total_amount), 0) as total_amount - FROM planting_order + FROM planting_orders WHERE status IN (${paidStatuses.map(s => `'${s}'`).join(', ')}) AND paid_at >= $1 AND paid_at IS NOT NULL