mirror of
https://github.com/v2board/v2board.git
synced 2025-01-11 00:29:09 +08:00
fix replace the negative subscription problem
This commit is contained in:
parent
b29ac8ac2c
commit
6ba4702539
@ -89,7 +89,8 @@ class OrderController extends Controller
|
||||
$trafficUnitPrice = $trafficUnitPrice - ($trafficUnitPrice * $user->discount / 100);
|
||||
}
|
||||
$notUsedTrafficPrice = $plan->transfer_enable - (($user->u + $user->d) / 1073741824);
|
||||
return $trafficUnitPrice * $notUsedTrafficPrice;
|
||||
$result = $trafficUnitPrice * $notUsedTrafficPrice;
|
||||
return $result ? $result : 0;
|
||||
}
|
||||
|
||||
private function getSurplusValueByCycle(User $user, Plan $plan)
|
||||
@ -109,7 +110,8 @@ class OrderController extends Controller
|
||||
$dayPrice = $dayPrice - ($dayPrice * $user->discount / 100);
|
||||
}
|
||||
$remainingDay = $user->expired_at - time();
|
||||
return $remainingDay * $dayPrice;
|
||||
$result = $remainingDay * $dayPrice;
|
||||
return $result ? $result : 0;
|
||||
}
|
||||
|
||||
public function save(OrderSave $request)
|
||||
|
Loading…
Reference in New Issue
Block a user