fix(mining-admin): 修复 Prisma 查询 null 值的语法

Prisma 查询 null 值需要使用 { equals: null } 而不是直接 null

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-21 01:58:08 -08:00
parent 27a045e082
commit 495a1445fd
1 changed files with 3 additions and 2 deletions

View File

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