| 
					
				 | 
			
			
				@@ -343,6 +343,14 @@ class RefundController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $prepayid = $order->join_order_member_id . '-CASH'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $this->refundToCash($order->join_order_member_id, $amount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $response = ['order_id' => $order->order_id, 'member_id' => $order->join_order_member_id]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } elseif (isset($payWay[1]) && $payWay[1] == 'WELFARE') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $prepayid = $order->join_order_member_id . '-WELFARE'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $this->refundToWelfare($order->join_order_member_id, $amount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $response = ['order_id' => $order->order_id, 'member_id' => $order->join_order_member_id]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                }  elseif (isset($payWay[1]) && $payWay[1] == 'VIP') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $prepayid = $order->join_order_member_id . '-VIP'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $this->refundToVIP($order->join_order_member_id, $amount); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    $response = ['order_id' => $order->order_id, 'member_id' => $order->join_order_member_id]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 } elseif (isset($payWay['1']) && $payWay[1] == 'CARD') { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $prepayid = $order->join_order_member_id . '-CARD'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                     $this->refundToCard($order->join_order_member_id, $amount); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -395,6 +403,47 @@ class RefundController extends Curd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $account->save(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @Desc 退款到福利账户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @Author Gorden 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @Date 2024/9/20 17:09 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param $memberId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param $amount 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return void 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @throws BusinessException 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private function refundToWelfare($memberId, $amount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $account = MemberAccount::where('join_account_member_id', $memberId)->where('member_account_classify', 'WELFARE')->first(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!$account) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new BusinessException("余额账户异常"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $account->member_account_surplus = $account->member_account_surplus + $amount; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $account->save(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @Desc 退款到VIP账户 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @Author Gorden 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @Date 2024/9/20 17:12 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param $memberId 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @param $amount 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @return void 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     * @throws BusinessException 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private function refundToVIP($memberId, $amount) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $account = MemberAccount::where('join_account_member_id', $memberId)->where('member_account_classify', 'VIP')->first(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if (!$account) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new BusinessException("余额账户异常"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $account->member_account_surplus = $account->member_account_surplus + $amount; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $account->save(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @Desc 退款到储蓄卡 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				      * @Author Gorden 
			 |