From 851c8e2f70681ff8fe42d990d7ed5609376de4cd Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 10 Dec 2024 21:12:35 +0800 Subject: [PATCH] :bug: Only pick featured posts in posts which visibility is all --- pkg/internal/services/featured.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/internal/services/featured.go b/pkg/internal/services/featured.go index 6d0931a..643b86d 100644 --- a/pkg/internal/services/featured.go +++ b/pkg/internal/services/featured.go @@ -31,8 +31,9 @@ func GetFeaturedPosts(count int) ([]models.Post, error) { ORDER BY social_points DESC LIMIT ? ) t ON p.id = t.post_id + WHERE p.visibility = ? ORDER BY t.social_points DESC, p.published_at DESC - `, deadline, count).Scan(&posts).Error; err != nil { + `, deadline, count, models.PostVisibilityAll).Scan(&posts).Error; err != nil { return posts, err }