From 870e82e155465d8512f492fb61753f0d2bd530fa Mon Sep 17 00:00:00 2001 From: tokumeikoi Date: Wed, 5 Jan 2022 15:07:48 +0800 Subject: [PATCH] update: fix reset day show --- app/Http/Controllers/User/UserController.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/User/UserController.php b/app/Http/Controllers/User/UserController.php index 4b664728..08cf6afc 100755 --- a/app/Http/Controllers/User/UserController.php +++ b/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; }