fix: posts in the recycle are not excluded when calculating posts under tag (#1823)

pull/1827/head
guqing 2022-04-07 20:35:33 +08:00 committed by GitHub
parent 7367556c12
commit 15dfa54e44
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -114,7 +114,8 @@ public interface PostTagRepository extends BaseRepository<PostTag, Integer> {
* @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<TagPostPostCountProjection> findPostCount();
}