diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/query/recommend/RecommendChannelQueryRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/query/recommend/RecommendChannelQueryRepository.kt index 3915203..fadfdc2 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/query/recommend/RecommendChannelQueryRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/query/recommend/RecommendChannelQueryRepository.kt @@ -72,10 +72,20 @@ class RecommendChannelQueryRepository( ) ) .from(audioContent) - .leftJoin(audioContentLike).on(audioContentLike.audioContent.id.eq(audioContent.id)) - .leftJoin(audioContentComment).on(audioContentComment.audioContent.id.eq(audioContent.id)) + .leftJoin(audioContentLike) + .on( + audioContentLike.audioContent.id.eq(audioContent.id) + .and(audioContentLike.isActive.isTrue) + ) + .leftJoin(audioContentComment) + .on( + audioContentComment.audioContent.id.eq(audioContent.id) + .and(audioContentComment.isActive.isTrue) + ) .where(audioContent.member.id.eq(creatorId)) .groupBy(audioContent.id) + .orderBy(audioContentLike.id.countDistinct().desc()) + .limit(3) .fetch() } }