Explorar o código

update: fix reset day show

tokumeikoi %!s(int64=3) %!d(string=hai) anos
pai
achega
870e82e155
Modificáronse 1 ficheiros con 6 adicións e 2 borrados
  1. 6 2
      app/Http/Controllers/User/UserController.php

+ 6 - 2
app/Http/Controllers/User/UserController.php

@@ -195,10 +195,14 @@ class UserController extends Controller
         $today = date('d');
         $lastDay = date('d', strtotime('last day of +0 months'));
 
-        if ((int)config('v2board.reset_traffic_method') === 0) {
+        if ((int)config('v2board.reset_traffic_method') === 0 ||
+            (isset($user->plan->reset_traffic_method) && $user->plan->reset_traffic_method === 0))
+        {
             return $lastDay - $today;
         }
-        if ((int)config('v2board.reset_traffic_method') === 1) {
+        if ((int)config('v2board.reset_traffic_method') === 1 ||
+            (isset($user->plan->reset_traffic_method) && $user->plan->reset_traffic_method === 1))
+        {
             if ((int)$day >= (int)$today && (int)$day >= (int)$lastDay) {
                 return $lastDay - $today;
             }