Skip to content

Commit

Permalink
+查询文章评论总数
Browse files Browse the repository at this point in the history
  • Loading branch information
zaoangod committed Oct 20, 2018
1 parent 3b52b88 commit 8fcabc0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/com/tale/extension/Theme.java
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,19 @@ public static Page<Comment> comments(int limit) {
return comments;
}

/**
* 获取当前文章/页面的评论数量
*
* @return 当前页面的评论数量
*/
public static long commentsCount() {
Contents contents = current_article();
if (null == contents) {
return 0;
}
return siteService.getCommentCount(contents.getCid());
}

/**
* 分页
*
Expand Down

0 comments on commit 8fcabc0

Please sign in to comment.