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

- 보이는 채널 조건 아래와 같이 변경
- 유료 콘텐츠 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 contentRankCreatorList = rankingService.fetchCreatorByContentRevenueRankTop20(
val contentRankCreatorList = rankingService.fetchCreatorBySellContentCountRankTop20(
memberId = member.id!!,
startDate = dailyRankingStartDate.minusDays(1),
endDate = dailyRankingEndDate

View File

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

View File

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

View File

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