Skip to content

Commit

Permalink
fix: 추천작 반환
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmondBreez3 committed Feb 10, 2024
1 parent 7699d06 commit 4660687
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ public void checkExists(String movieId) {
public List<RecommendedPopcorn> findAllThisWeek() {
QRecommendedPopcorn recommendedPopcorn = QRecommendedPopcorn.recommendedPopcorn;

LocalDate today = LocalDate.now().plusDays(1);
LocalDate startOfThisWeek = today.with(DayOfWeek.SUNDAY);
LocalDate endOfThisWeek = today.with(DayOfWeek.SATURDAY);
LocalDate today = LocalDate.now();
LocalDate tomorrow = LocalDate.now().plusDays(1);
LocalDate startOfThisWeek = tomorrow.with(DayOfWeek.SUNDAY);
LocalDate endOfThisWeek = tomorrow.with(DayOfWeek.SATURDAY);

return jpaQueryFactory
.selectFrom(recommendedPopcorn)
.where(
recommendedPopcorn.createdAt.between(startOfThisWeek.atStartOfDay(), endOfThisWeek.atTime(23, 59, 59))
recommendedPopcorn.createdAt.between(today.atStartOfDay(), endOfThisWeek.atTime(23, 59, 59))
)
.orderBy(
recommendedPopcorn.createdAt.asc()
Expand Down

0 comments on commit 4660687

Please sign in to comment.