门店账户多账号

This commit is contained in:
2026-07-12 12:24:34 +08:00
parent 06b1cb22e0
commit 54a15d6da7
39 changed files with 1962 additions and 311 deletions
@@ -185,11 +185,17 @@ export class AdminWechatBindingsService {
const accounts = await this.prisma.storeAccount.findMany({
where,
include: { store: { select: { id: true, name: true } } },
include: {
bindings: {
take: 1,
include: { store: { select: { id: true, name: true } } },
},
},
});
for (const a of accounts) {
if (!a.wxOpenId) continue;
const firstStore = a.bindings[0]?.store;
rows.push({
actorType: 'STORE',
actorId: a.id,
@@ -197,8 +203,8 @@ export class AdminWechatBindingsService {
name: a.name,
wxOpenId: a.wxOpenId,
wxUnionId: a.wxUnionId,
refId: a.storeId,
refLabel: a.store.name,
refId: firstStore?.id,
refLabel: firstStore?.name ?? a.name,
lastLoginAt: a.lastLoginAt,
status: a.status,
});