update change order process

This commit is contained in:
Tokumeikoi
2020-02-18 13:52:10 +08:00
parent 64ae39aa2d
commit 14d0de18ec
2 changed files with 5 additions and 0 deletions

View File

@ -85,6 +85,10 @@ class OrderController extends Controller
} else if ($plan->year_price) {
$dayPrice = $plan->year_price / 31536000;
}
// exclude discount
if ($user->discount) {
$dayPrice = $dayPrice * $user->discount / 100;
}
$remainingDay = $user->expired_at - time();
return $remainingDay * $dayPrice;
}