Merge pull request #1726 from AndreasK79/search_fix
[Search] Fix for partial search when callsign contains slash
这个提交包含在:
		
						当前提交
						cc2e02f8ac
					
				
					共有  1 个文件被更改,包括 58 次插入 和 42 次删除
				
			
		
							
								
								
									
										46
									
								
								application/controllers/Logbook.php
									
									
									
									
									
										
										
										可执行文件 -> 普通文件
									
								
							
							
						
						
									
										46
									
								
								application/controllers/Logbook.php
									
									
									
									
									
										
										
										可执行文件 -> 普通文件
									
								
							|  | @ -642,29 +642,27 @@ class Logbook extends CI_Controller { | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	function search_result($id="") { | 	function search_result($id="", $id2="") { | ||||||
| 		$this->load->model('user_model'); | 		$this->load->model('user_model'); | ||||||
| 		 | 		 | ||||||
| 		if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; } | 		if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; } | ||||||
| 		 | 		 | ||||||
| 		//$this->db->select(''.$this->config->item('table_name').'.COL_CALL, '.$this->config->item('table_name').'.COL_BAND, '.$this->config->item('table_name').'.COL_TIME_ON, '.$this->config->item('table_name').'.COL_RST_RCVD, '.$this->config->item('table_name').'.COL_RST_SENT, '.$this->config->item('table_name').'.COL_MODE, '.$this->config->item('table_name').'.COL_SUBMODE, '.$this->config->item('table_name').'.COL_NAME, '.$this->config->item('table_name').'.COL_COUNTRY, '.$this->config->item('table_name').'.COL_PRIMARY_KEY, '.$this->config->item('table_name').'.COL_SAT_NAME, '.$this->config->item('table_name').'.COL_GRIDSQUARE, '.$this->config->item('table_name').'.COL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_RCVD, '.$this->config->item('table_name').'.COL_EQSL_QSL_SENT, '.$this->config->item('table_name').'.COL_QSL_SENT, '.$this->config->item('table_name').'.COL_STX, '.$this->config->item('table_name').'.COL_STX_STRING, '.$this->config->item('table_name').'.COL_SRX, '.$this->config->item('table_name').'.COL_SRX_STRING, '.$this->config->item('table_name').'.COL_LOTW_QSL_SENT, '.$this->config->item('table_name').'.COL_LOTW_QSL_RCVD, '.$this->config->item('table_name').'.COL_VUCC_GRIDS, station_profile.*');
 | 		$fixedid = $id; | ||||||
| 
 | 
 | ||||||
| 		$this->db->from($this->config->item('table_name')); | 		if ($id2 != "") { | ||||||
| 		$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); | 			$fixedid = $id . '/' . $id2; | ||||||
| 		$this->db->group_start(); | 		} | ||||||
| 		$this->db->like(''.$this->config->item('table_name').'.COL_CALL', $id); |  | ||||||
| 		$this->db->or_like(''.$this->config->item('table_name').'.COL_GRIDSQUARE', $id); |  | ||||||
| 		$this->db->or_like(''.$this->config->item('table_name').'.COL_VUCC_GRIDS', $id); |  | ||||||
| 		$this->db->group_end(); |  | ||||||
| 		$this->db->where('station_profile.user_id', $this->session->userdata('user_id')); |  | ||||||
| 		$this->db->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', 'desc'); |  | ||||||
| 		$query = $this->db->get(); |  | ||||||
| 
 | 
 | ||||||
| 		if ($query->num_rows() > 0) | 		$query = $this->querydb($fixedid); | ||||||
| 		{ | 
 | ||||||
|  | 		if ($query->num_rows() == 0) { | ||||||
|  | 			$query = $this->querydb($id); | ||||||
|  | 			 | ||||||
|  | 			if ($query->num_rows() > 0) { | ||||||
| 				$data['results'] = $query; | 				$data['results'] = $query; | ||||||
| 				$this->load->view('view_log/partial/log_ajax.php', $data); | 				$this->load->view('view_log/partial/log_ajax.php', $data); | ||||||
| 		} else { | 			} | ||||||
|  | 			else { | ||||||
| 				$this->load->model('search'); | 				$this->load->model('search'); | ||||||
| 
 | 
 | ||||||
| 				$iota_search = $this->search->callsign_iota($id); | 				$iota_search = $this->search->callsign_iota($id); | ||||||
|  | @ -696,6 +694,23 @@ class Logbook extends CI_Controller { | ||||||
| 					$this->load->view('search/result', $data); | 					$this->load->view('search/result', $data); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
|  | 		} else { | ||||||
|  | 			$data['results'] = $query; | ||||||
|  | 			$this->load->view('view_log/partial/log_ajax.php', $data); | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	function querydb($id) { | ||||||
|  | 		$this->db->from($this->config->item('table_name')); | ||||||
|  | 		$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); | ||||||
|  | 		$this->db->group_start(); | ||||||
|  | 		$this->db->like(''.$this->config->item('table_name').'.COL_CALL', $id); | ||||||
|  | 		$this->db->or_like(''.$this->config->item('table_name').'.COL_GRIDSQUARE', $id); | ||||||
|  | 		$this->db->or_like(''.$this->config->item('table_name').'.COL_VUCC_GRIDS', $id); | ||||||
|  | 		$this->db->group_end(); | ||||||
|  | 		$this->db->where('station_profile.user_id', $this->session->userdata('user_id')); | ||||||
|  | 		$this->db->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', 'desc'); | ||||||
|  | 		return $this->db->get(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| 	function search_duplicates($station_id) { | 	function search_duplicates($station_id) { | ||||||
|  | @ -729,6 +744,7 @@ class Logbook extends CI_Controller { | ||||||
| 		$data['qsos'] = $query; | 		$data['qsos'] = $query; | ||||||
| 
 | 
 | ||||||
| 		$this->load->view('search/duplicates_result.php', $data); | 		$this->load->view('search/duplicates_result.php', $data); | ||||||
|  | 
 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	/* | 	/* | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用