فهرست منبع

update: fix coupon

tokumeikoi 2 سال پیش
والد
کامیت
9250d7b19c
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      app/Services/CouponService.php

+ 1 - 1
app/Services/CouponService.php

@@ -38,8 +38,8 @@ class CouponService
             $order->discount_amount = $order->total_amount;
         }
         if ($this->coupon->limit_use !== NULL) {
-            $this->coupon->limit_use = $this->coupon->limit_use - 1;
             if ($this->coupon->limit_use <= 0) return false;
+            $this->coupon->limit_use = $this->coupon->limit_use - 1;
             if (!$this->coupon->save()) {
                 return false;
             }