mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
update: surplus by onetime
This commit is contained in:
parent
b5a614d901
commit
7ec4b06536
@ -170,13 +170,9 @@ class OrderService
|
|||||||
->orderBy('id', 'DESC')
|
->orderBy('id', 'DESC')
|
||||||
->first();
|
->first();
|
||||||
if (!$lastOneTimeOrder) return;
|
if (!$lastOneTimeOrder) return;
|
||||||
$plan = Plan::find($lastOneTimeOrder->plan_id);
|
$nowUserTraffic = $user->transfer_enable / 1073741824;
|
||||||
if (!$plan) return;
|
$trafficUnitPrice = ($lastOneTimeOrder->total_amount + $lastOneTimeOrder->balance_amount) / $nowUserTraffic;
|
||||||
$trafficUnitPrice = $plan->onetime_price / $plan->transfer_enable;
|
$notUsedTraffic = $nowUserTraffic - (($user->u + $user->d) / 1073741824);
|
||||||
if ($user->discount && $trafficUnitPrice) {
|
|
||||||
$trafficUnitPrice = $trafficUnitPrice - ($trafficUnitPrice * $user->discount / 100);
|
|
||||||
}
|
|
||||||
$notUsedTraffic = $plan->transfer_enable - (($user->u + $user->d) / 1073741824);
|
|
||||||
$result = $trafficUnitPrice * $notUsedTraffic;
|
$result = $trafficUnitPrice * $notUsedTraffic;
|
||||||
$orderModel = Order::where('user_id', $user->id)->where('period', '!=', 'reset_price')->where('status', 3);
|
$orderModel = Order::where('user_id', $user->id)->where('period', '!=', 'reset_price')->where('status', 3);
|
||||||
$order->surplus_amount = $result > 0 ? $result : 0;
|
$order->surplus_amount = $result > 0 ? $result : 0;
|
||||||
|
2
public/theme/v2board/assets/umi.js
vendored
2
public/theme/v2board/assets/umi.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user