mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 01:11:46 +08:00 
			
		
		
		
	fix: change plan refund surplus amount
This commit is contained in:
		| @@ -202,7 +202,7 @@ class OrderService | ||||
|             if ($item->cycle === 'onetime_price') continue; | ||||
|             if ($this->orderIsUsed($item)) continue; | ||||
|             $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; | ||||
|         $monthUnitPrice = $orderSurplusAmount / $orderSurplusMonth; | ||||
|   | ||||
| @@ -55,7 +55,7 @@ class UserService | ||||
|  | ||||
|     public function addBalance(int $userId, int $balance):bool | ||||
|     { | ||||
|         $user = User::find($userId); | ||||
|         $user = User::lockForUpdate()->find($userId); | ||||
|         if (!$user) { | ||||
|             return false; | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user