This commit is contained in:
root
2020-01-01 23:40:14 +08:00
parent 8bc5004654
commit 89d67279c6
3 changed files with 22 additions and 2 deletions

View File

@ -15,6 +15,9 @@ class CouponController extends Controller
if (!$coupon) {
abort(500, '优惠券无效');
}
if ($coupon->limit_use <= 0) {
abort(500, '优惠券已无可用次数');
}
if (time() < $coupon->started_at) {
abort(500, '优惠券还未到可用时间');
}