Skip to content

Commit

Permalink
fix: popcorn 뿌려주는 것 시간대 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmondBreez3 committed Feb 10, 2024
1 parent 71e1a0a commit cd048a5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ public List<Popcorn> findLastWeekPopcorns() {
QPopcorn popcorn = QPopcorn.popcorn;

LocalDateTime today = LocalDateTime.now();
LocalDateTime startWeek = today.with(DayOfWeek.SUNDAY).minusWeeks(1);
LocalDateTime endThisWeek = today.with(DayOfWeek.SATURDAY);
//LocalDateTime startWeek = today.with(DayOfWeek.SUNDAY).minusWeeks(1);
LocalDateTime endNextWeek = today.with(DayOfWeek.SATURDAY).plusWeeks(1);

return jpaQueryFactory
.selectFrom(popcorn)
.where(popcorn.createdAt.between(startWeek, endThisWeek.withHour(23).withMinute(59).withSecond(59)))
.where(popcorn.createdAt.between(today, endNextWeek.withHour(23).withMinute(59).withSecond(59)))
.orderBy(
popcorn.recommendationCount.desc(),
popcorn.createdAt.desc()
Expand Down

0 comments on commit cd048a5

Please sign in to comment.