From 15dfa54e444635e93dec59e507c71cb3b0a7f09a Mon Sep 17 00:00:00 2001 From: guqing <38999863+guqing@users.noreply.github.com> Date: Thu, 7 Apr 2022 20:35:33 +0800 Subject: [PATCH] fix: posts in the recycle are not excluded when calculating posts under tag (#1823) --- src/main/java/run/halo/app/repository/PostTagRepository.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/run/halo/app/repository/PostTagRepository.java b/src/main/java/run/halo/app/repository/PostTagRepository.java index fde7646dc..40c7f3e13 100644 --- a/src/main/java/run/halo/app/repository/PostTagRepository.java +++ b/src/main/java/run/halo/app/repository/PostTagRepository.java @@ -114,7 +114,8 @@ public interface PostTagRepository extends BaseRepository { * @return a list of tag post count projection */ @Query("select new run.halo.app.model.projection.TagPostPostCountProjection(count(pt.postId)," - + " pt.tagId) from PostTag pt group by pt.tagId") + + " pt.tagId) from PostTag pt inner join Post p on p.id=pt.postId and" + + " p.status<>2 group by pt.tagId") @NonNull List findPostCount(); }