门店账户多账号
This commit is contained in:
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user