Explorar o código

update: fix coupon

tokumeikoi %!s(int64=2) %!d(string=hai) anos
pai
achega
9250d7b19c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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;
             }