瀏覽代碼

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;
             }