|
|
@ -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()); |
|
|
|