Tokumeikoi 5 years ago
parent
commit
64f379d99d
1 changed files with 3 additions and 0 deletions
  1. 3 0
      app/Http/Controllers/User/OrderController.php

+ 3 - 0
app/Http/Controllers/User/OrderController.php

@@ -100,6 +100,9 @@ class OrderController extends Controller
     {
         $dayPrice = 0;
         $day = ($user->expired_at - time()) / 86400;
+        if ($day <= 0) {
+            return 0;
+        }
         if ($plan->month_price) {
             $dayPrice = $plan->month_price / $day;
         } else if ($plan->quarter_price) {