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; $dayPrice = $plan->year_price / 31536000;
} }
// exclude discount // exclude discount
if ($user->discount) { if ($user->discount && $dayPrice) {
$dayPrice = $dayPrice * $user->discount / 100; $dayPrice = $dayPrice - ($dayPrice * $user->discount / 100);
} }
$remainingDay = $user->expired_at - time(); $remainingDay = $user->expired_at - time();
return $remainingDay * $dayPrice; return $remainingDay * $dayPrice;