mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
update change order process
This commit is contained in:
parent
64ae39aa2d
commit
14d0de18ec
@ -83,6 +83,7 @@ class CheckOrder extends Command
|
|||||||
$user->plan_id = $plan->id;
|
$user->plan_id = $plan->id;
|
||||||
$user->group_id = $plan->group_id;
|
$user->group_id = $plan->group_id;
|
||||||
$user->expired_at = $this->getTime($order->cycle, $user->expired_at);
|
$user->expired_at = $this->getTime($order->cycle, $user->expired_at);
|
||||||
|
|
||||||
if ($user->save()) {
|
if ($user->save()) {
|
||||||
$order->status = 3;
|
$order->status = 3;
|
||||||
$order->save();
|
$order->save();
|
||||||
|
@ -85,6 +85,10 @@ class OrderController extends Controller
|
|||||||
} else if ($plan->year_price) {
|
} else if ($plan->year_price) {
|
||||||
$dayPrice = $plan->year_price / 31536000;
|
$dayPrice = $plan->year_price / 31536000;
|
||||||
}
|
}
|
||||||
|
// exclude discount
|
||||||
|
if ($user->discount) {
|
||||||
|
$dayPrice = $dayPrice * $user->discount / 100;
|
||||||
|
}
|
||||||
$remainingDay = $user->expired_at - time();
|
$remainingDay = $user->expired_at - time();
|
||||||
return $remainingDay * $dayPrice;
|
return $remainingDay * $dayPrice;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user