城市合伙人端的修改(后台)

This commit is contained in:
2026-07-12 10:19:39 +08:00
parent d0f0fa09af
commit 7f031cc4c2
74 changed files with 5430 additions and 975 deletions
@@ -152,15 +152,22 @@ export class PartnerMeController {
async me(@CurrentUser() user: AuthUser) {
const account = await this.prisma.partnerAccount.findUniqueOrThrow({
where: { id: user.actorId },
include: { partner: true },
});
let primary = account;
if (account.isPrimary !== 1 && account.parentAccountId) {
primary = await this.prisma.partnerAccount.findUniqueOrThrow({
where: { id: account.parentAccountId },
});
}
return {
id: account.id.toString(),
name: account.name,
phone: account.phone,
isPrimary: account.isPrimary === 1,
staffRole: account.staffRole ?? undefined,
companyName: account.partner.companyName,
permissions: Array.isArray(account.permissions) ? account.permissions : undefined,
primaryAccountId: primary.id.toString(),
companyName: primary.companyName ?? undefined,
hasWechat: !!account.wxOpenId,
};
}