mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
order: expire user is new order
This commit is contained in:
parent
f204dd2d72
commit
e2a07cc4d1
@ -46,7 +46,7 @@ class OrderService
|
|||||||
$order = $this->order;
|
$order = $this->order;
|
||||||
if ($order->cycle === 'reset_price') {
|
if ($order->cycle === 'reset_price') {
|
||||||
$order->type = 4;
|
$order->type = 4;
|
||||||
} else if ($user->plan_id !== NULL && $order->plan_id !== $user->plan_id) {
|
} else if ($user->plan_id !== NULL && $order->plan_id !== $user->plan_id && $user->expired_at > time()) { // 用户订阅存在且用户订阅与购买订阅不同且用户订阅未过期 === 更换
|
||||||
if (!(int)config('v2board.plan_change_enable', 1)) abort(500, '目前不允许更改订阅,请联系客服或提交工单操作');
|
if (!(int)config('v2board.plan_change_enable', 1)) abort(500, '目前不允许更改订阅,请联系客服或提交工单操作');
|
||||||
$order->type = 3;
|
$order->type = 3;
|
||||||
$this->getSurplusValue($user, $order);
|
$this->getSurplusValue($user, $order);
|
||||||
@ -56,9 +56,9 @@ class OrderService
|
|||||||
} else {
|
} else {
|
||||||
$order->total_amount = $order->total_amount - $order->surplus_amount;
|
$order->total_amount = $order->total_amount - $order->surplus_amount;
|
||||||
}
|
}
|
||||||
} else if ($user->expired_at > time() && $order->plan_id == $user->plan_id) {
|
} else if ($user->expired_at > time() && $order->plan_id == $user->plan_id) { // 用户订阅未过期且购买订阅与当前订阅相同 === 续费
|
||||||
$order->type = 2;
|
$order->type = 2;
|
||||||
} else {
|
} else { // 新购
|
||||||
$order->type = 1;
|
$order->type = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user