update change order process

This commit is contained in:
Tokumeikoi 2020-02-18 14:52:26 +08:00
parent 9f5be4e83a
commit 568648dc2f

View File

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