ソースを参照

库存为0的优惠券,也要查询出来

zc 2 ヶ月 前
コミット
3095b6b400

+ 1 - 1
alien-store/src/main/java/shop/alien/store/service/impl/LifeDiscountCouponServiceImpl.java

@@ -347,7 +347,7 @@ public class LifeDiscountCouponServiceImpl extends ServiceImpl<LifeDiscountCoupo
         List<LifeDiscountCouponVo> lifeDiscountCouponVos = new ArrayList<>();
         LocalDate now = LocalDate.now();
         //根据店铺id查询该店铺的优惠券,状态是开启领取的券
-        List<LifeDiscountCoupon> lifeDiscountCoupons = lifeDiscountCouponMapper.selectList(new LambdaQueryWrapper<LifeDiscountCoupon>().eq(LifeDiscountCoupon::getStoreId, storeId).eq(LifeDiscountCoupon::getGetStatus, "1").gt(LifeDiscountCoupon::getSingleQty, 0) //还有库存
+        List<LifeDiscountCoupon> lifeDiscountCoupons = lifeDiscountCouponMapper.selectList(new LambdaQueryWrapper<LifeDiscountCoupon>().eq(LifeDiscountCoupon::getStoreId, storeId).eq(LifeDiscountCoupon::getGetStatus, "1") //还有库存
                 .ge(LifeDiscountCoupon::getEndGetDate, now).orderByDesc(LifeDiscountCoupon::getCreatedTime));
         //根据优惠券列表查询该优惠券是否领取过
         for (LifeDiscountCoupon lifeDiscountCoupon : lifeDiscountCoupons) {