绑定邀请人

This commit is contained in:
2025-10-27 20:52:22 +08:00
parent d8171cfb75
commit abca38dd53

View File

@@ -204,12 +204,12 @@ public class MkDistributionUserServiceImpl extends ServiceImpl<MkDistributionUse
ShopUser shopUser = shopUserService.getById(param.getShopUserId());
AssertUtil.isNull(shopUser, "店铺用户不存在");
AssertUtil.isNull(shopUser.getDistributionUserId(), "店铺用户已绑定分销员");
MkDistributionUser mkDistributionUser = this.getById(param.getParentId());
AssertUtil.isNull(mkDistributionUser, "上级分销员不存在");
MkDistributionUser parent = getOne(QueryWrapper.create().eq(MkDistributionUser::getInviteCode, param.getInviteCount()));
AssertUtil.isNull(parent, "邀请人不存在");
ShopUser newShopUser = new ShopUser();
newShopUser.setId(shopUser.getId());
newShopUser.setDistributionUserId(mkDistributionUser.getId());
newShopUser.setDistributionUserParentId(mkDistributionUser.getParentId());
newShopUser.setDistributionUserId(parent.getId());
newShopUser.setDistributionUserParentId(parent.getParentId());
shopUserService.updateById(newShopUser);
}