From b37714cf3eac2ff17ac0cb4ae24171bb26edb478 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 24 Nov 2019 23:21:29 +0800 Subject: [PATCH] update --- app/Http/Controllers/Admin/ConfigController.php | 4 +++- app/Http/Controllers/OrderController.php | 2 ++ app/Http/Requests/Admin/ConfigSave.php | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Admin/ConfigController.php b/app/Http/Controllers/Admin/ConfigController.php index c640d6a5..2905f919 100755 --- a/app/Http/Controllers/Admin/ConfigController.php +++ b/app/Http/Controllers/Admin/ConfigController.php @@ -29,7 +29,9 @@ class ConfigController extends Controller 'email_verify' => (int)config('v2board.email_verify', 0), 'app_name' => config('v2board.app_name', 'V2Board'), 'app_url' => config('v2board.app_url'), - 'subscribe_url' => config('v2board.subscribe_url') + 'subscribe_url' => config('v2board.subscribe_url'), + 'plan_upgrade_fee' => config('v2board.plan_upgrade_fee', 0.5), + 'plan_is_upgrade' => config('v2board.plan_is_upgrade', 1) ], 'pay' => [ // alipay diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index 25f79fde..92a9dddd 100755 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -72,6 +72,8 @@ class OrderController extends Controller $order->total_amount = $plan[$request->input('cycle')]; if ($user->expired_at > time() && $order->plan_id !== $user->plan_id) { $order->type = 3; + if ($plan->transfer_enable * 1073741824 < $user->transfer_enable) 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 b371c463..da3e935a 100755 --- a/app/Http/Requests/Admin/ConfigSave.php +++ b/app/Http/Requests/Admin/ConfigSave.php @@ -17,6 +17,8 @@ class ConfigSave extends FormRequest 'app_name', 'app_url', 'subscribe_url', + 'plan_upgrade_fee', + 'plan_is_upgrade', // server 'server_token', // alipay