mirror of
				https://github.com/v2board/v2board.git
				synced 2025-11-01 01:41:47 +08:00 
			
		
		
		
	update: fix onetime refund issue
This commit is contained in:
		| @@ -163,7 +163,13 @@ class OrderService | |||||||
|  |  | ||||||
|     private function getSurplusValueByOneTime(User $user, Order $order) |     private function getSurplusValueByOneTime(User $user, Order $order) | ||||||
|     { |     { | ||||||
|         $plan = Plan::find($user->plan_id); |         $lastOneTimeOrder = Order::where('user_id', $user->id) | ||||||
|  |             ->where('period', 'onetime') | ||||||
|  |             ->where('status', 3) | ||||||
|  |             ->orderBy('id', 'DESC') | ||||||
|  |             ->first(); | ||||||
|  |         if (!$lastOneTimeOrder) return; | ||||||
|  |         $plan = Plan::find($lastOneTimeOrder->plan_id); | ||||||
|         $trafficUnitPrice = $plan->onetime_price / $plan->transfer_enable; |         $trafficUnitPrice = $plan->onetime_price / $plan->transfer_enable; | ||||||
|         if ($user->discount && $trafficUnitPrice) { |         if ($user->discount && $trafficUnitPrice) { | ||||||
|             $trafficUnitPrice = $trafficUnitPrice - ($trafficUnitPrice * $user->discount / 100); |             $trafficUnitPrice = $trafficUnitPrice - ($trafficUnitPrice * $user->discount / 100); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user