|
@@ -12,6 +12,7 @@ import cn.newfeifan.mall.module.distri.service.duser.DuserService;
|
|
|
import cn.newfeifan.mall.module.distri.service.socialstatus.SocialStatusService;
|
|
|
import cn.newfeifan.mall.module.member.dal.dataobject.user.MemberUserDO;
|
|
|
import cn.newfeifan.mall.module.member.service.user.MemberUserService;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -135,8 +136,8 @@ public class SharePathServiceImpl implements SharePathService {
|
|
|
|
|
|
//获取团队数
|
|
|
LambdaQueryWrapperX<SharePathDO> wrapper = new LambdaQueryWrapperX<>();
|
|
|
- wrapper.eq(SharePathDO::getAncestor, userId).or().eq(SharePathDO::getDescendant, userId);
|
|
|
- // +1为父级
|
|
|
+ wrapper.eq(SharePathDO::getAncestor, userId).eq(SharePathDO::getDepth, 1);
|
|
|
+ // +1 加自己
|
|
|
Long teamCount = sharePathMapper.selectCount(wrapper) + 1;
|
|
|
|
|
|
//获取推荐人
|
|
@@ -151,12 +152,19 @@ public class SharePathServiceImpl implements SharePathService {
|
|
|
|
|
|
//获取团队成员
|
|
|
PageResult<SharePathDO> descendants = sharePathMapper.selectPage(pageParam, new LambdaQueryWrapperX<SharePathDO>()
|
|
|
- .eq(SharePathDO::getAncestor, userId)
|
|
|
- .orderByAsc(SharePathDO::getDepth));
|
|
|
+ .eq(SharePathDO::getAncestor, userId)
|
|
|
+ .eq(SharePathDO::getDepth, 1)
|
|
|
+ .orderByAsc(SharePathDO::getDepth)
|
|
|
+ );
|
|
|
PageResult<SharePathRespVO> result = BeanUtils.toBean(descendants, SharePathRespVO.class);
|
|
|
result.getList().forEach(item -> {
|
|
|
item.setAvatar(getAvatar(item.getDescendant()));
|
|
|
getSocialStatus(item, item.getDescendant());
|
|
|
+
|
|
|
+ Long descendantsCount = sharePathMapper.selectCount(new LambdaQueryWrapper<SharePathDO>()
|
|
|
+ .eq(SharePathDO::getAncestor, item.getDescendant())
|
|
|
+ );
|
|
|
+ item.setDescendantsCount(descendantsCount);
|
|
|
});
|
|
|
|
|
|
|