热榜过滤未审核帖子

master
panqihua 5 years ago
parent 1ed7507181
commit e336d30461
  1. 4
      src/main/java/com/community/pocket/repository/android/ForumDao.java

@ -51,8 +51,8 @@ public class ForumDao extends BaseDao<Forum> {
//查找热门贴
public List<ForumHot> rankReply(Forum.ForumType type, int num) {
List<ForumHot> forumHots=new ArrayList<>();
List<Forum> forumList =mongoTemplate.find(new Query(Criteria.where("forumType").is(type)).with(Sort.by("reply").descending()).limit(num),entityClass());
List<ForumHot> forumHots = new ArrayList<>();
List<Forum> forumList = mongoTemplate.find(new Query(Criteria.where("forumType").is(type).and("status").is(Forum.ForumStatus.ok)).with(Sort.by("reply").descending()).limit(num), entityClass());
for(Forum forum:forumList){
ForumHot forumHot=new ForumHot();
forumHot.setForumId(forum.getId());

Loading…
Cancel
Save