| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -53,6 +53,28 @@ class AgentProductController extends Controller | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							return $this->success($list); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						//旅游线路搜索
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public function travel_search() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							$formData = request()->only(['departure_place', 'destination']); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							if (empty($formData['departure_place']) && empty($formData['destination'])) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								return $this->error('请输入出发地和目的地'); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							$list = AgentProduct::list($this->agent_id)->whereHas('product', function($query) use ($formData) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (!empty($formData['departure_place'])) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$query->whereRaw("extends->'$.field_0_departure_place' LIKE ?", ["%{$formData['departure_place']}%"]); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								if (!empty($formData['destination'])) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
									$query->whereRaw("extends->'$.field_0_destination' LIKE ?", ["%{$formData['destination']}%"]); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
								} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							})->orderBy('id', 'DESC')->simplePaginate(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							$list = $this->paginatePicAddHost($list); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
							return $this->success($list); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						} | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						// 产品详情
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						public function show() | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
						{ | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |