diff --git a/app/Console/Commands/CheckOrder.php b/app/Console/Commands/CheckOrder.php index 3dbb5a7d..3f615d33 100755 --- a/app/Console/Commands/CheckOrder.php +++ b/app/Console/Commands/CheckOrder.php @@ -69,8 +69,8 @@ class CheckOrder extends Command private function buy($order, $user) { $plan = Plan::find($order->plan_id); - // change plan process, try out is enable and plan - if ((int)$order->type === 3) { + // change plan process + 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 f3ca5869..6087e4ef 100755 --- a/app/Http/Controllers/Admin/ConfigController.php +++ b/app/Http/Controllers/Admin/ConfigController.php @@ -32,8 +32,7 @@ class ConfigController extends Controller 'subscribe_url' => config('v2board.subscribe_url'), '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'), + 'try_out_plan_id' => (int)config('v2board.try_out_plan_id', 0), 'try_out_hour' => (int)config('v2board.try_out_hour', 1) ], 'pay' => [ diff --git a/app/Http/Controllers/Passport/AuthController.php b/app/Http/Controllers/Passport/AuthController.php index 3f98d8bc..a43f74f8 100644 --- a/app/Http/Controllers/Passport/AuthController.php +++ b/app/Http/Controllers/Passport/AuthController.php @@ -63,7 +63,7 @@ class AuthController extends Controller } // try out - if ((int)config('v2board.try_out_enable', 0)) { + if ((int)config('v2board.try_out_plan_id', 0)) { $plan = Plan::find(config('v2board.try_out_plan_id')); if ($plan) { $user->transfer_enable = $plan->transfer_enable * 1073741824;