| 
					
				 | 
			
			
				@@ -53,6 +53,14 @@ class Settlement implements ShouldQueue 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //注册gateway地址 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Gateway::$registerAddress = '127.0.0.1:1238'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if($room_question_count > 4){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            //结算当前局 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            $update_data["end_at"] = date("Y-m-d H:i:s"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            RoomQuestion::where([ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                "room_id" => $this->room_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                "question_id" => $question_id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ])->update($update_data); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             //当前房间结束 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             $update_data["end_at"] = date("Y-m-d H:i:s"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             Room::where("room_id", $this->room_id)->update($update_data); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -134,6 +142,8 @@ class Settlement implements ShouldQueue 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $message['winer_score'] = $winer_score; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 $message['type'] = 'game_end'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 Gateway::sendToUid($user->user_id, json_encode($message)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                //结束当前房间 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                Gateway::ungroup($this->room_id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				             } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         }else{ 
			 |