From d8848a05af648356d08ec4e7678bc6f6e5fca982 Mon Sep 17 00:00:00 2001 From: KwonJuHwan <118177454+KwonJuHwan@users.noreply.github.com> Date: Thu, 25 Jan 2024 18:19:17 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20=EC=9D=BC=EA=B0=84=20=EC=BF=A0?= =?UTF-8?q?=ED=8F=B0=20=EB=A6=AC=ED=8F=AC=ED=8A=B8=20=EC=BF=BC=EB=A6=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/coupon/repository/CouponRepositoryImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java index c48e372..2ee32ad 100644 --- a/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java +++ b/src/main/java/com/coolpeace/domain/coupon/repository/CouponRepositoryImpl.java @@ -162,7 +162,8 @@ public List 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(); } @@ -178,8 +179,7 @@ public List findAllByExposureDate(Accommodation accommodation, LocalDate public List 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 @@ -187,6 +187,6 @@ public List 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(); } }