root 5 years ago
parent
commit
2a693e4911

+ 1 - 1
app/Http/Controllers/CouponController.php

@@ -15,7 +15,7 @@ class CouponController extends Controller
         if (!$coupon) {
             abort(500, '优惠券无效');
         }
-        if ($coupon->limit_use <= 0) {
+        if ($coupon->limit_use <= 0 && $coupon->limit_use !== NULL) {
             abort(500, '优惠券已无可用次数');
         }
         if (time() < $coupon->started_at) {

+ 1 - 1
app/Http/Controllers/OrderController.php

@@ -79,7 +79,7 @@ class OrderController extends Controller
             if (!$coupon) {
                 abort(500, '优惠券无效');
             }
-            if ($coupon->limit_use <= 0) {
+            if ($coupon->limit_use <= 0 && $coupon->limit_use !== NULL) {
                 abort(500, '优惠券已无可用次数');
             }
             if (time() < $coupon->started_at) {