你可以实现这个功能。问题在于查询使用了 badge_posts 表,而该表不包含受保护分类中的帖子。如果将查询改为使用 posts 表而不是 badge_posts 表,应该就能正常工作。
badge_posts
posts