Skip to content

Commit

Permalink
Merge pull request #198 from CoolPeace-yanolza/develop
Browse files Browse the repository at this point in the history
1월 25일 18시 배포
  • Loading branch information
KwonJuHwan authored Jan 25, 2024
2 parents fd8a449 + ffd2f41 commit 6a90269
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ public List<Coupon> expiration3days(Long memberId, Long accommodationId) {
.where(coupon.member.id.eq(memberId)
.and(coupon.accommodation.id.eq(accommodationId))
.and(coupon.couponStatus.ne(DELETED))
.and(coupon.exposureEndDate.before(LocalDate.now().plusDays(3))))
.and(coupon.exposureEndDate.between(LocalDate.now().minusDays(1),
LocalDate.now().plusDays(4))))
.fetch();
}

Expand All @@ -178,15 +179,14 @@ public List<Coupon> findAllByExposureDate(Accommodation accommodation, LocalDate
public List<Coupon> endExposureCoupons(LocalDate nowDate) {
return jpaQueryFactory.selectFrom(coupon)
.where(coupon.couponStatus.ne(CouponStatusType.DELETED)
.and((coupon.exposureEndDate.before(nowDate))
.or(coupon.exposureEndDate.eq(nowDate)))).fetch();
.and(coupon.exposureEndDate.before(nowDate))).fetch();
}

@Override
public List<Coupon> startExposureCoupons(LocalDate nowDate) {
return jpaQueryFactory.selectFrom(coupon)
.where(coupon.couponStatus.eq(CouponStatusType.EXPOSURE_WAIT)
.and((coupon.exposureStartDate.after(nowDate))
.or(coupon.exposureStartDate.eq(LocalDate.now())))).fetch();
.or(coupon.exposureStartDate.eq(nowDate)))).fetch();
}
}

0 comments on commit 6a90269

Please sign in to comment.