|
|
@@ -145,7 +145,11 @@ public class UserService {
|
|
|
if (ObjectUtil.isNotNull(parent)) {
|
|
|
// if (this.getParent(parent, userInfo)) {
|
|
|
if (ObjectUtil.isNull(userInfo.getParent())) {
|
|
|
- userInfo.setParent(parent);
|
|
|
+ User parentUser = userRepo.findById(parent).orElseThrow(new BusinessException("无上级"));
|
|
|
+ // 上级不是普通会员
|
|
|
+ if (!Member.NORMAL.equals(parentUser.getMember())){
|
|
|
+ userInfo.setParent(parent);
|
|
|
+ }
|
|
|
}
|
|
|
// 邀请成为黄金佳人 就改变上级为邀请者
|
|
|
if (expert && !userInfo.isVip()) {
|
|
|
@@ -518,7 +522,7 @@ public class UserService {
|
|
|
身份升级
|
|
|
*/
|
|
|
public void upgrade(Long parent) {
|
|
|
- long num = userRepo.countByParentAndDelFalse(parent);
|
|
|
+ long num = userRepo.countByParentAndMemberAndDelFalse(parent,Member.EXPERT);
|
|
|
// 成为钻石合伙人
|
|
|
int upgradePartner = sysConfigService.getInt("UPGRADE_PARTNER");
|
|
|
if (num > upgradePartner) {
|