mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update order change process
This commit is contained in:
parent
874648a4c0
commit
a0a5327f42
@ -70,9 +70,12 @@ class CheckOrder extends Command
|
||||
{
|
||||
$plan = Plan::find($order->plan_id);
|
||||
// change plan process
|
||||
if ($order->type === 3) {
|
||||
if ($order->type == 3) {
|
||||
$user->expired_at = time();
|
||||
}
|
||||
if ($order->refund_amount) {
|
||||
$user->balance = $user->balance + $order->refund_amount;
|
||||
}
|
||||
$user->transfer_enable = $plan->transfer_enable * 1073741824;
|
||||
$user->enable = 1;
|
||||
$user->u = 0;
|
||||
|
@ -143,6 +143,7 @@ class OrderController extends Controller
|
||||
$order->type = 3;
|
||||
$order->surplus_amount = $this->getSurplusValue($user);
|
||||
if ($order->surplus_amount >= $order->total_amount) {
|
||||
$order->refund_amount = $order->surplus_amount - $order->total_amount;
|
||||
$order->total_amount = 0;
|
||||
} else {
|
||||
$order->total_amount = $order->total_amount - $order->surplus_amount;
|
||||
|
@ -159,3 +159,6 @@ ADD `discount` int(11) NULL AFTER `balance`;
|
||||
|
||||
ALTER TABLE `v2_order`
|
||||
ADD `surplus_amount` int(11) NULL COMMENT '剩余价值' AFTER `discount_amount`;
|
||||
|
||||
ALTER TABLE `v2_order`
|
||||
ADD `refund_amount` int(11) NULL COMMENT '退款金额' AFTER `surplus_amount`;
|
||||
|
Loading…
Reference in New Issue
Block a user