feat(admin): HQ手机号编辑、合伙人子账号日志与子账号H5体验

支持 HQ 账户改手机号(格式校验)、合伙人日志包含子账号且子账号不显示主账号信息;改手机号时清除微信绑定。合伙人 H5 子账号页签与我的页、录入门店底部按钮及上传失败提示。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-12 13:29:09 +08:00
parent b8623f59f0
commit 63af3321dd
16 changed files with 259 additions and 40 deletions
@@ -252,11 +252,15 @@ export class AdminPartnersService {
assertPartnerCommissionRates(city, orderCommissionRate, redeemCommissionRate);
}
const phoneChanged =
dto.phone !== undefined && dto.phone.trim() !== existing.phone;
const account = await this.prisma.partnerAccount.update({
where: { id },
data: {
...(dto.name !== undefined ? { name: dto.name.trim() } : {}),
...(dto.phone !== undefined ? { phone: dto.phone.trim() } : {}),
...(phoneChanged ? { wxOpenId: null, wxUnionId: null } : {}),
...(dto.companyName !== undefined ? { companyName: dto.companyName.trim() } : {}),
...(dto.address !== undefined ? { address: dto.address.trim() } : {}),
...(dto.contactPhone !== undefined ? { contactPhone: dto.contactPhone.trim() } : {}),
@@ -446,6 +450,10 @@ export class AdminPartnersService {
throw new BadRequestException('该手机号已被使用');
}
data.phone = phone;
if (phone !== existing.phone) {
data.wxOpenId = null;
data.wxUnionId = null;
}
}
const account = await this.prisma.partnerAccount.update({ where: { id }, data });