ソースを参照

update change order process

Tokumeikoi 5 年 前
コミット
568648dc2f
1 ファイル変更2 行追加2 行削除
  1. 2 2
      app/Http/Controllers/User/OrderController.php

+ 2 - 2
app/Http/Controllers/User/OrderController.php

@@ -86,8 +86,8 @@ class OrderController extends Controller
             $dayPrice = $plan->year_price / 31536000;
         }
         // exclude discount
-        if ($user->discount) {
-            $dayPrice = $dayPrice * $user->discount / 100;
+        if ($user->discount && $dayPrice) {
+            $dayPrice = $dayPrice - ($dayPrice * $user->discount / 100);
         }
         $remainingDay = $user->expired_at - time();
         return $remainingDay * $dayPrice;