绑定问题

This commit is contained in:
2026-01-31 15:39:55 +08:00
parent 9a62fcaddf
commit 0ebe2b1787

View File

@@ -327,11 +327,8 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
if (shopUserInvite != null && shopUserInvite.getParentUserId() != null) { if (shopUserInvite != null && shopUserInvite.getParentUserId() != null) {
throw new CzgException("店铺用户已存在上级"); throw new CzgException("店铺用户已存在上级");
} }
MkDistributionUser parent = getOne(QueryWrapper.create().eq(MkDistributionUser::getId, fromUserId)); MkDistributionUser parent = getOne(QueryWrapper.create().eq(MkDistributionUser::getId, fromUserId).eq(MkDistributionUser::getShopId, shopId));
AssertUtil.isNull(parent, "邀请人不存在"); AssertUtil.isNull(parent, "邀请人不存在");
if (!parent.getShopId().equals(shopId)) {
throw new CzgException("邀请人不是本店铺的分销员");
}
if (parent.getId().equals(shopUser.getId())) { if (parent.getId().equals(shopUser.getId())) {
throw new CzgException("不能绑定自己为上级"); throw new CzgException("不能绑定自己为上级");
} }