diff --git a/app/Services/CouponService.php b/app/Services/CouponService.php index bb92b89..8cdd3ab 100644 --- a/app/Services/CouponService.php +++ b/app/Services/CouponService.php @@ -61,6 +61,27 @@ class CouponService extends BaseService } } + // 判断该优惠卷状态 + if ($coupon['coupon_status'] != 1){ + // 优惠卷状态异常 + return true; + } + + // 判断该优惠卷过期时间 + if ($coupon['coupon_status'] != 1){ + return true; + } + + // 判断该优惠卷过期时间 + if ($coupon['valid_type'] == 1){ + // 绝对时效 + $date = date('Y-m-d H:i:s',time()); + if ($coupon['valid_end_time'] < $date){ + // 超出结束使用时间 + return true; + } + } + try { // 添加用户优惠卷表 $data = array();