mirror of
https://github.com/v2board/v2board.git
synced 2025-02-25 06:40:26 +08:00
fix: change plan refund surplus amount
This commit is contained in:
parent
4d38ce3968
commit
88948eb8ee
@ -202,7 +202,7 @@ class OrderService
|
|||||||
if ($item->cycle === 'onetime_price') continue;
|
if ($item->cycle === 'onetime_price') continue;
|
||||||
if ($this->orderIsUsed($item)) continue;
|
if ($this->orderIsUsed($item)) continue;
|
||||||
$orderSurplusMonth = $orderSurplusMonth + self::STR_TO_TIME[$item->cycle];
|
$orderSurplusMonth = $orderSurplusMonth + self::STR_TO_TIME[$item->cycle];
|
||||||
$orderSurplusAmount = $orderSurplusAmount + ($item['total_amount'] + $item['balance_amount']);
|
$orderSurplusAmount = $orderSurplusAmount + ($item['total_amount'] + $item['balance_amount'] + $item['surplus_amount']);
|
||||||
}
|
}
|
||||||
if (!$orderSurplusMonth || !$orderSurplusAmount) return;
|
if (!$orderSurplusMonth || !$orderSurplusAmount) return;
|
||||||
$monthUnitPrice = $orderSurplusAmount / $orderSurplusMonth;
|
$monthUnitPrice = $orderSurplusAmount / $orderSurplusMonth;
|
||||||
|
@ -55,7 +55,7 @@ class UserService
|
|||||||
|
|
||||||
public function addBalance(int $userId, int $balance):bool
|
public function addBalance(int $userId, int $balance):bool
|
||||||
{
|
{
|
||||||
$user = User::find($userId);
|
$user = User::lockForUpdate()->find($userId);
|
||||||
if (!$user) {
|
if (!$user) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user