fix(home): 인기 커뮤니티 후보에서 팔로워 집계를 제외한다

This commit is contained in:
2026-07-12 11:33:22 +09:00
parent de37fd0ebe
commit abd9cb897a
2 changed files with 6 additions and 23 deletions

View File

@@ -686,17 +686,10 @@ class DefaultHomeRecommendationQueryRepository(
and ccc.created_at >= :windowStart
and ccc.created_at < :windowEndExclusive
group by ccc.creator_community_id
),
follower_stats as (
select cf.creator_id as creator_id, count(distinct cf.id) as follower_count
from creator_following cf
where cf.is_active = true
group by cf.creator_id
)
select cc.id as target_id,
((coalesce(ls.like_count, 0) * ${RecommendationScoreSpec.COMMUNITY_LIKE_WEIGHT} +
(case when cc.is_comment_available = true then coalesce(cs.comment_count, 0) else 0 end) * ${RecommendationScoreSpec.COMMUNITY_COMMENT_WEIGHT} +
coalesce(fs.follower_count, 0) * ${RecommendationScoreSpec.COMMUNITY_FOLLOWER_WEIGHT}) *
(case when cc.is_comment_available = true then coalesce(cs.comment_count, 0) else 0 end) * ${RecommendationScoreSpec.COMMUNITY_COMMENT_WEIGHT}) *
case
when cd.debut_at >= :boost10Start then ${RecommendationScoreSpec.COMMUNITY_NEW_BOOST_10_DAYS}
when cd.debut_at >= :boost20Start then ${RecommendationScoreSpec.COMMUNITY_NEW_BOOST_20_DAYS}
@@ -709,7 +702,6 @@ class DefaultHomeRecommendationQueryRepository(
join creator_debut cd on cd.creator_id = cc.member_id
left join like_stats ls on ls.community_id = cc.id
left join comment_stats cs on cs.community_id = cc.id
left join follower_stats fs on fs.creator_id = cc.member_id
where cc.is_active = true
and m.is_active = true
and cc.price <= 0
@@ -719,7 +711,6 @@ class DefaultHomeRecommendationQueryRepository(
and (
coalesce(ls.like_count, 0) > 0
or (cc.is_comment_available = true and coalesce(cs.comment_count, 0) > 0)
or coalesce(fs.follower_count, 0) > 0
)
order by score desc, random_tie_breaker asc
limit :limit