Bläddra i källkod

update change order process

Tokumeikoi 5 år sedan
förälder
incheckning
568648dc2f
1 ändrade filer med 2 tillägg och 2 borttagningar
  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;