Browse Source

我参与项目 排序

zyh
小久哥 3 years ago
parent
commit
79b5eb0836
  1. 6
      zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java

6
zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/service/project/ProjectServiceImpl.java

@ -153,7 +153,6 @@ public class ProjectServiceImpl implements ProjectService {
LocalDateTime startTime = pageDTO.getTimeLimit() == 2 ? nowTime.minusDays(3) : nowTime.minusDays(14);
queryWrapperX.between(ProjectDO::getCreateTime, startTime, nowTime);
}
queryWrapperX.eqIfPresent(ProjectDO::getDraft, pageDTO.getDraft());
if (pageDTO.getDraft()){
//查看自己的草稿
@ -165,11 +164,10 @@ public class ProjectServiceImpl implements ProjectService {
CpUserDO user = cpUserMapper.selectOne(Wrappers.<CpUserDO>lambdaQuery().eq(CpUserDO::getUserId, adminUser.getUsername()));
if (ObjectUtil.isNotEmpty(user)){
//查看我参与或创建的项目
queryWrapperX.last(" and (JSON_CONTAINS(members, '"+ user.getId()+"') or creator = " + getLoginUserId() +") ORDER BY id") ;
queryWrapperX.apply(" ((JSON_CONTAINS(members, '"+ user.getId()+"') or creator = " + getLoginUserId() +"))");
}
}else{
queryWrapperX.orderByDesc(ProjectDO::getId);
}
queryWrapperX.orderByDesc(ProjectDO::getId);
List<ProjectDO> list = projectMapper.selectList(queryWrapperX);
if (ObjectUtil.isEmpty(list)){

Loading…
Cancel
Save