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