Compare commits

..

No commits in common. "efe8f4f939b0510234e7f25db61cd8721d8cbb0a" and "ba692a11953de25cf7c164f4e716d3e5f88861fc" have entirely different histories.

1 changed files with 5 additions and 14 deletions

View File

@ -337,18 +337,9 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
limit: Long
): List<GetAudioContentMainItem> {
val orderBy = when (sortType) {
SortType.NEWEST -> listOf(audioContent.releaseDate.desc(), audioContent.id.desc())
SortType.PRICE_HIGH -> listOf(
audioContent.price.desc(),
audioContent.releaseDate.desc(),
audioContent.id.desc()
)
SortType.PRICE_LOW -> listOf(
audioContent.price.asc(),
audioContent.releaseDate.asc(),
audioContent.id.asc()
)
SortType.NEWEST -> audioContent.releaseDate.desc()
SortType.PRICE_HIGH -> audioContent.price.desc()
SortType.PRICE_LOW -> audioContent.price.asc()
}
var where = audioContent.isActive.isTrue
@ -386,7 +377,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
.where(where)
.offset(offset)
.limit(limit)
.orderBy(*orderBy.toTypedArray())
.orderBy(orderBy)
.fetch()
}
@ -489,7 +480,7 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
.where(where)
.offset(offset)
.limit(limit)
.orderBy(audioContent.releaseDate.desc(), audioContent.id.desc())
.orderBy(audioContent.releaseDate.desc())
.fetch()
}