优惠券获取,超出当前时间被渲染问题处理,增加状态和时间判定

This commit is contained in:
Chopper 2021-09-01 14:49:59 +08:00
parent 88109995bb
commit 42e9ee06f4
2 changed files with 6 additions and 4 deletions

View File

@ -18,13 +18,12 @@ public enum PromotionTypeEnum {
FULL_DISCOUNT("满减"),
POINTS_GOODS("积分商品"),
KANJIA("砍价"),
COUPON_ACTIVITY("优惠券活动")
;
COUPON_ACTIVITY("优惠券活动");
/**
* 拼团秒杀拥有独立库存如果其他促销也有独立库存涉及库存扣减的请添加在下方
* 有促销库存的活动类型
*/
static PromotionTypeEnum[] haveStockPromotion = new PromotionTypeEnum[]{PINTUAN, SECKILL, KANJIA};
static PromotionTypeEnum[] haveStockPromotion = new PromotionTypeEnum[]{SECKILL, KANJIA, POINTS_GOODS};
private final String description;

View File

@ -90,6 +90,9 @@ public class MemberCouponServiceImpl extends ServiceImpl<MemberCouponMapper, Mem
public List<MemberCoupon> getMemberCoupons() {
QueryWrapper<MemberCoupon> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("member_id", UserContext.getCurrentUser().getId());
queryWrapper.ge("member_coupon_status", MemberCouponStatusEnum.NEW.name());
queryWrapper.ge("start_time", System.currentTimeMillis());
queryWrapper.le("end_time", System.currentTimeMillis());
return this.list(queryWrapper);
}