콘텐츠 메인 - 홈, 단편 - 채널별 인기 콘텐츠

- 보이는 채널 조건 아래와 같이 변경
- 유료 콘텐츠 4개 이상 등록한 채널의 주간 콘텐츠 판매 개수 Top 20
This commit is contained in:
Klaus 2025-02-17 11:54:08 +09:00
parent 3d1716d847
commit 239516b98b
4 changed files with 15 additions and 16 deletions

View File

@ -69,7 +69,7 @@ class AudioContentMainTabContentService(
// 이벤트 배너 // 이벤트 배너
val eventBannerList = eventService.getEventList(isAdult = isAdult) val eventBannerList = eventService.getEventList(isAdult = isAdult)
val contentRankCreatorList = rankingService.fetchCreatorByContentRevenueRankTop20( val contentRankCreatorList = rankingService.fetchCreatorBySellContentCountRankTop20(
memberId = member.id!!, memberId = member.id!!,
startDate = dailyRankingStartDate.minusDays(1), startDate = dailyRankingStartDate.minusDays(1),
endDate = dailyRankingEndDate endDate = dailyRankingEndDate

View File

@ -74,11 +74,10 @@ class AudioContentMainTabHomeService(
/* 채널별 인기 콘텐츠 /* 채널별 인기 콘텐츠
* - 콘텐츠를 4 이상 등록한 채널 * - 콘텐츠를 4 이상 등록한 채널
* - 주간 콘텐츠 매출 Top 20 채널 * - 주간 콘텐츠 판매 개수 Top 20 채널
* - 해당 채널의 누적 매출 Top 2 * - 해당 채널의 누적 판매 개수 Top 4
* - 해당 채널의 누적 판매 개수 Top 2
*/ */
val contentRankCreatorList = rankingService.fetchCreatorByContentRevenueRankTop20( val contentRankCreatorList = rankingService.fetchCreatorBySellContentCountRankTop20(
memberId = member.id!!, memberId = member.id!!,
startDate = startDate.minusDays(1), startDate = startDate.minusDays(1),
endDate = endDate endDate = endDate

View File

@ -336,7 +336,7 @@ class RankingRepository(
.fetch() .fetch()
} }
fun fetchCreatorByContentRevenueRankTop20( fun fetchCreatorBySellContentCountRankTop20(
memberId: Long, memberId: Long,
startDate: LocalDateTime, startDate: LocalDateTime,
endDate: LocalDateTime endDate: LocalDateTime
@ -350,9 +350,12 @@ class RankingRepository(
.and(order.createdAt.goe(startDate)) .and(order.createdAt.goe(startDate))
.and(order.createdAt.lt(startDate)) .and(order.createdAt.lt(startDate))
val where = member.isActive.isTrue val memberCondition = member.isActive.isTrue
.and(member.role.eq(MemberRole.CREATOR)) .and(member.role.eq(MemberRole.CREATOR))
.and(audioContent.isActive.isTrue) .and(member.id.eq(audioContent.member.id))
val where = audioContent.isActive.isTrue
.and(audioContent.price.gt(0))
.and(audioContent.duration.isNotNull) .and(audioContent.duration.isNotNull)
.and(audioContent.limited.isNull) .and(audioContent.limited.isNull)
.and(blockMember.id.isNull) .and(blockMember.id.isNull)
@ -365,17 +368,14 @@ class RankingRepository(
member.profileImage.prepend("/").prepend(imageHost) member.profileImage.prepend("/").prepend(imageHost)
) )
) )
.from(member) .from(audioContent)
.innerJoin(audioContent).on(member.id.eq(audioContent.member.id)) .innerJoin(member).on(memberCondition)
.leftJoin(order).on(ordersCondition) .leftJoin(order).on(ordersCondition)
.leftJoin(blockMember).on(blockMemberCondition) .leftJoin(blockMember).on(blockMemberCondition)
.where(where) .where(where)
.groupBy(member.id) .groupBy(member.id)
.having(audioContent.id.count().goe(4)) .having(audioContent.id.count().goe(4))
.orderBy( .orderBy(order.id.count().desc(), member.id.desc())
order.can.sum().desc(),
Expressions.numberTemplate(Double::class.java, "function('rand')").asc()
)
.offset(0) .offset(0)
.limit(20) .limit(20)
.fetch() .fetch()

View File

@ -181,12 +181,12 @@ class RankingService(
} }
} }
fun fetchCreatorByContentRevenueRankTop20( fun fetchCreatorBySellContentCountRankTop20(
memberId: Long, memberId: Long,
startDate: LocalDateTime, startDate: LocalDateTime,
endDate: LocalDateTime endDate: LocalDateTime
): List<ContentCreatorResponse> { ): List<ContentCreatorResponse> {
return repository.fetchCreatorByContentRevenueRankTop20(memberId, startDate, endDate) return repository.fetchCreatorBySellContentCountRankTop20(memberId, startDate, endDate)
} }
fun fetchCreatorContentBySalesTop2( fun fetchCreatorContentBySalesTop2(