From 708cd12d2500d3be22baf5ef06aefaaee17a3027 Mon Sep 17 00:00:00 2001 From: guqing <38999863+guqing@users.noreply.github.com> Date: Fri, 30 Sep 2022 17:44:19 +0800 Subject: [PATCH] fix: total comment count for page and singlepage (#2498) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement /area core /milestone 2.0 #### What this PR does / why we need it: 修复文章和自定义页面的总评论数量统计取值错误 #### Which issue(s) this PR fixes: Fixes # #### Special notes for your reviewer: /cc @halo-dev/sig-halo #### Does this PR introduce a user-facing change? ```release-note None ``` --- src/main/java/run/halo/app/content/impl/PostServiceImpl.java | 2 +- .../java/run/halo/app/content/impl/SinglePageServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/run/halo/app/content/impl/PostServiceImpl.java b/src/main/java/run/halo/app/content/impl/PostServiceImpl.java index 3253110d7f..f1d4e6feaf 100644 --- a/src/main/java/run/halo/app/content/impl/PostServiceImpl.java +++ b/src/main/java/run/halo/app/content/impl/PostServiceImpl.java @@ -85,7 +85,7 @@ Stats fetchStats(Post post) { return Stats.builder() .visit(counter.getVisit()) .upvote(counter.getUpvote()) - .totalComment(counter.getApprovedComment()) + .totalComment(counter.getTotalComment()) .approvedComment(counter.getApprovedComment()) .build(); } diff --git a/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java b/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java index 294daa9e30..fe319af9f0 100644 --- a/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java +++ b/src/main/java/run/halo/app/content/impl/SinglePageServiceImpl.java @@ -218,7 +218,7 @@ Stats fetchStats(SinglePage singlePage) { return Stats.builder() .visit(counter.getVisit()) .upvote(counter.getUpvote()) - .totalComment(counter.getApprovedComment()) + .totalComment(counter.getTotalComment()) .approvedComment(counter.getApprovedComment()) .build(); }