Compare commits

...

3 Commits

Author SHA1 Message Date
klaus 8fffad9d3a Merge pull request 'test' (#284) from test into main
Reviewed-on: #284
2025-03-13 12:25:35 +00:00
Klaus 327b0149d9 콘텐츠 홈 단편 탭
- 유료 콘텐츠만 나오도록 수정
2025-03-13 21:16:42 +09:00
Klaus b822cf47bb 광고 통계
- 전체 개수 계산시 NonUniqueResultException 버그 수정
2025-03-13 19:51:58 +09:00
3 changed files with 19 additions and 16 deletions

View File

@ -14,18 +14,17 @@ import java.time.LocalDateTime
@Repository @Repository
class AdminAdStatisticsRepository(private val queryFactory: JPAQueryFactory) { class AdminAdStatisticsRepository(private val queryFactory: JPAQueryFactory) {
fun getAdStatisticsDataTotalCount(): Int { fun getAdStatisticsDataTotalCount(): Int {
return ( return queryFactory
queryFactory .select(adTrackingHistory.id.pid)
.select(adTrackingHistory.id.pid.count()) .from(adTrackingHistory)
.from(adTrackingHistory) .groupBy(
.groupBy( getFormattedDate(adTrackingHistory.id.createdAt),
getFormattedDate(adTrackingHistory.id.createdAt), adTrackingHistory.mediaGroup,
adTrackingHistory.mediaGroup, adTrackingHistory.id.pid,
adTrackingHistory.id.pid, adTrackingHistory.pidName
adTrackingHistory.pidName )
) .fetch()
.fetchOne() ?: 0L .size
).toInt()
} }
fun getAdStatisticsDataList( fun getAdStatisticsDataList(

View File

@ -410,8 +410,10 @@ class AudioContentQueryRepositoryImpl(
where = where.and(audioContentTheme.theme.`in`(theme)) where = where.and(audioContentTheme.theme.`in`(theme))
} }
if (isFree) { where = if (isFree) {
where = where.and(audioContent.price.loe(0)) where.and(audioContent.price.loe(0))
} else {
where.and(audioContent.price.gt(0))
} }
return queryFactory return queryFactory

View File

@ -35,8 +35,10 @@ class AudioContentThemeQueryRepository(
where = where.and(audioContent.isAdult.isFalse) where = where.and(audioContent.isAdult.isFalse)
} }
if (isFree) { where = if (isFree) {
where = where.and(audioContent.price.loe(0)) where.and(audioContent.price.loe(0))
} else {
where.and(audioContent.price.gt(0))
} }
return queryFactory return queryFactory