热榜过滤未审核帖子

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

@ -52,7 +52,7 @@ public class ForumDao extends BaseDao<Forum> {
//查找热门贴 //查找热门贴
public List<ForumHot> rankReply(Forum.ForumType type, int num) { public List<ForumHot> rankReply(Forum.ForumType type, int num) {
List<ForumHot> forumHots = new ArrayList<>(); 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<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){ for(Forum forum:forumList){
ForumHot forumHot=new ForumHot(); ForumHot forumHot=new ForumHot();
forumHot.setForumId(forum.getId()); forumHot.setForumId(forum.getId());

Loading…
Cancel
Save