|
|
@@ -52,7 +52,12 @@ public class CommentQuery extends JBaseQuery {
|
|
|
needWhere = appendIfNotEmpty(fromBuilder, " c.parent_id", parentCommentId, params, needWhere);
|
|
|
needWhere = appendIfNotEmpty(fromBuilder, " content.id", contentId, params, needWhere);
|
|
|
|
|
|
- fromBuilder.append("order by c.created desc");
|
|
|
+ if ("uuhelper".equals(module)) {
|
|
|
+ //软文详情页评论排序,先按是否置顶排,再按点赞数排,最后按评论时间排。
|
|
|
+ fromBuilder.append("ORDER BY c.order_number desc,c.vote_up desc, c.created desc");
|
|
|
+ } else {
|
|
|
+ fromBuilder.append("order by c.created desc");
|
|
|
+ }
|
|
|
|
|
|
if (params.isEmpty()) {
|
|
|
return DAO.paginate(pageNumber, pageSize, select, fromBuilder.toString());
|
|
|
@@ -129,6 +134,10 @@ public class CommentQuery extends JBaseQuery {
|
|
|
return paginateWithContent(pageNumber, pageSize, null, null, contentId, null, Comment.STATUS_NORMAL);
|
|
|
}
|
|
|
|
|
|
+ public Page<Comment> uuHelperPaginateByContentId(int pageNumber, int pageSize, BigInteger contentId, String module) {
|
|
|
+ return paginateWithContent(pageNumber, pageSize, module, null, contentId, null, Comment.STATUS_NORMAL);
|
|
|
+ }
|
|
|
+
|
|
|
public long findCountByContentIdInNormal(BigInteger contentId) {
|
|
|
return findCountByContentId(contentId, Comment.STATUS_NORMAL);
|
|
|
}
|