From 495a1445fd2c552e18d360a2724d565bc8f27e36 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 21 Jan 2026 01:58:08 -0800 Subject: [PATCH] =?UTF-8?q?fix(mining-admin):=20=E4=BF=AE=E5=A4=8D=20Prism?= =?UTF-8?q?a=20=E6=9F=A5=E8=AF=A2=20null=20=E5=80=BC=E7=9A=84=E8=AF=AD?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prisma 查询 null 值需要使用 { equals: null } 而不是直接 null Co-Authored-By: Claude Opus 4.5 --- .../src/application/services/system-accounts.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/services/mining-admin-service/src/application/services/system-accounts.service.ts b/backend/services/mining-admin-service/src/application/services/system-accounts.service.ts index c6dc494e..8ff2abcf 100644 --- a/backend/services/mining-admin-service/src/application/services/system-accounts.service.ts +++ b/backend/services/mining-admin-service/src/application/services/system-accounts.service.ts @@ -326,9 +326,10 @@ export class SystemAccountsService { page: number = 1, pageSize: number = 20, ) { + // Prisma 查询 null 值需要用 { equals: null } const whereClause = regionCode ? { accountType, regionCode } - : { accountType, regionCode: null }; + : { accountType, regionCode: { equals: null } }; const [records, total] = await Promise.all([ this.prisma.syncedSystemContributionRecord.findMany({ @@ -380,7 +381,7 @@ export class SystemAccountsService { const whereClause = regionCode ? { accountType, regionCode } - : { accountType, regionCode: null }; + : { accountType, regionCode: { equals: null } }; // 获取明细记录统计 const recordStats = await this.prisma.syncedSystemContributionRecord.aggregate({