@@ -93,6 +93,17 @@ export class AdminStoresService {
|
||||
}),
|
||||
this.prisma.store.count({ where }),
|
||||
]);
|
||||
|
||||
// 每家店是否有待审核套餐变更,供总部列表「审核套餐 / 对比」快捷入口使用
|
||||
const pendingByStore = new Map<string, string>();
|
||||
if (items.length) {
|
||||
const pendingReqs = await this.prisma.storePackageChangeRequest.findMany({
|
||||
where: { storeId: { in: items.map((s) => s.id) }, status: 'PENDING' },
|
||||
select: { id: true, storeId: true },
|
||||
});
|
||||
for (const r of pendingReqs) pendingByStore.set(r.storeId.toString(), r.id.toString());
|
||||
}
|
||||
|
||||
return serializeBigInt({
|
||||
items: items.map((s) => {
|
||||
const { visibilityPhones, ...rest } = s;
|
||||
@@ -100,6 +111,8 @@ export class AdminStoresService {
|
||||
...rest,
|
||||
visibilityWhitelistEnabled: s.visibilityWhitelistEnabled,
|
||||
visibilityPhones: visibilityPhones.map((p) => p.phone),
|
||||
// 透传:mapStoreCompat 为 { ...store } 展开,新字段不会被丢弃
|
||||
pendingPackageAuditId: pendingByStore.get(s.id.toString()) ?? null,
|
||||
partner: s.partnerAccount,
|
||||
account: s.bindings[0]?.storeAccount ?? null,
|
||||
bindings: undefined,
|
||||
|
||||
Reference in New Issue
Block a user