From 8fcabc0d7089bd82a26febe1ae96d016d7ced307 Mon Sep 17 00:00:00 2001 From: zaoangod Date: Sun, 21 Oct 2018 00:39:57 +0800 Subject: [PATCH] =?UTF-8?q?+=E6=9F=A5=E8=AF=A2=E6=96=87=E7=AB=A0=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/tale/extension/Theme.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/tale/extension/Theme.java b/src/main/java/com/tale/extension/Theme.java index 426ab6c7..9aac7623 100644 --- a/src/main/java/com/tale/extension/Theme.java +++ b/src/main/java/com/tale/extension/Theme.java @@ -647,6 +647,19 @@ public static Page comments(int limit) { return comments; } + /** + * 获取当前文章/页面的评论数量 + * + * @return 当前页面的评论数量 + */ + public static long commentsCount() { + Contents contents = current_article(); + if (null == contents) { + return 0; + } + return siteService.getCommentCount(contents.getCid()); + } + /** * 分页 *