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 4660687 commit b47a2f5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ public void checkExists(String movieId) {
public List<RecommendedPopcorn> findAllThisWeek() {
QRecommendedPopcorn recommendedPopcorn = QRecommendedPopcorn.recommendedPopcorn;

LocalDate today = LocalDate.now();

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

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

0 comments on commit b47a2f5

Please sign in to comment.