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