From 415850184e5a40994aedf19af8a8529eb0afddbf Mon Sep 17 00:00:00 2001 From: root Date: Sun, 12 Jan 2020 02:02:45 +0800 Subject: [PATCH] update --- app/Console/Commands/CheckOrder.php | 2 +- app/Http/Controllers/Admin/ConfigController.php | 2 +- app/Http/Controllers/OrderController.php | 2 +- app/Http/Requests/Admin/ConfigSave.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/CheckOrder.php b/app/Console/Commands/CheckOrder.php index 82bea380..ef7f2418 100755 --- a/app/Console/Commands/CheckOrder.php +++ b/app/Console/Commands/CheckOrder.php @@ -70,7 +70,7 @@ class CheckOrder extends Command { $plan = Plan::find($order->plan_id); // change plan process, try out is enable and plan - if ($order->type === 3 && config('v2board.try_out_enable', 0) && config('v2board.try_out_plan_id') !== $user->plan_id) { + if ((int)$order->type === 3 && (int)config('v2board.try_out_plan_id') !== (int)$user->plan_id) { $transferEnableDifference = $plan->transfer_enable - ($user->transfer_enable / 1073741824); $user->expired_at = $user->expired_at - ($transferEnableDifference * config('v2board.plan_transfer_hour', 12) * 3600); } diff --git a/app/Http/Controllers/Admin/ConfigController.php b/app/Http/Controllers/Admin/ConfigController.php index 7cc42f23..5c42d2f5 100755 --- a/app/Http/Controllers/Admin/ConfigController.php +++ b/app/Http/Controllers/Admin/ConfigController.php @@ -32,7 +32,7 @@ class ConfigController extends Controller 'app_name' => config('v2board.app_name', 'V2Board'), 'app_url' => config('v2board.app_url'), 'subscribe_url' => config('v2board.subscribe_url'), - 'plan_is_update' => (int)config('v2board.plan_is_update', 1), + 'plan_change_enable' => (int)config('v2board.plan_change_enable', 1), 'plan_transfer_hour' => config('v2board.plan_transfer_hour', 12), 'try_out_enable' => (int)config('v2board.try_out_enable', 0), 'try_out_plan_id' => (int)config('v2board.try_out_plan_id'), diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index e5bc8806..bbbd9b1c 100755 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -122,7 +122,7 @@ class OrderController extends Controller // renew and change subscribe process if ($user->expired_at > time() && $order->plan_id !== $user->plan_id) { $order->type = 3; - if (!(int)config('v2board.plan_is_update', 1)) abort(500, '目前不允许更改订阅,请联系管理员'); + if (!(int)config('v2board.plan_change_enable', 1)) abort(500, '目前不允许更改订阅,请联系管理员'); } else if ($user->expired_at > time() && $order->plan_id == $user->plan_id) { $order->type = 2; } else { diff --git a/app/Http/Requests/Admin/ConfigSave.php b/app/Http/Requests/Admin/ConfigSave.php index 6b3419ba..ca1f9cec 100755 --- a/app/Http/Requests/Admin/ConfigSave.php +++ b/app/Http/Requests/Admin/ConfigSave.php @@ -17,7 +17,7 @@ class ConfigSave extends FormRequest 'app_url' => 'url', 'subscribe_url' => 'url', 'plan_transfer_hour' => 'numeric', - 'plan_is_update' => 'in:0,1', + 'plan_change_enable' => 'in:0,1', 'try_out_enable' => 'in:0,1', 'try_out_plan_id' => 'integer', 'try_out_hour' => 'numeric',