mirror of
https://github.com/v2board/v2board.git
synced 2025-02-10 15:39:14 +08:00
update
This commit is contained in:
parent
d268f6ddec
commit
1cd0dbdd31
@ -67,6 +67,11 @@ class CheckOrder extends Command
|
||||
|
||||
private function buy ($order, $user) {
|
||||
$plan = Plan::find($order->plan_id);
|
||||
// change plan process
|
||||
if ($order->type === 3) {
|
||||
$transferEnableDifference = $plan->transfer_enable - ($user->transfer_enable / 1073741824);
|
||||
$user->expired_at = $user->expired_at - ($transferEnableDifference * 1 * 60);
|
||||
}
|
||||
$user->transfer_enable = $plan->transfer_enable * 1073741824;
|
||||
$user->enable = 1;
|
||||
$user->plan_id = $plan->id;
|
||||
|
@ -115,7 +115,7 @@ class OrderController extends Controller
|
||||
if ($user->expired_at > time() && $order->plan_id !== $user->plan_id) {
|
||||
$order->type = 3;
|
||||
if (!(int)config('v2board.plan_is_update', 1)) abort(500, '目前不允许更改订阅,请联系管理员');
|
||||
$order->total_amount = $order->total_amount + (ceil(($user->expired_at - time()) / 86400) * config('v2board.plan_update_fee', 0.5) * 100);
|
||||
// $order->total_amount = $order->total_amount + (ceil(($user->expired_at - time()) / 86400) * config('v2board.plan_update_fee', 0.5) * 100);
|
||||
} else if ($user->expired_at > time() && $order->plan_id == $user->plan_id) {
|
||||
$order->type = 2;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user