From 47150086b41d2f38f02660d64d9d8a0c968654ba Mon Sep 17 00:00:00 2001 From: wucongxing <815046773@qq.com> Date: Thu, 9 Nov 2023 14:22:19 +0800 Subject: [PATCH] 1 --- app/Services/CouponService.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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();