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({