[Search] Fix for partial search when callsign contains slash

这个提交包含在:
Andreas 2022-10-28 10:53:45 +02:00
父节点 8e938c8ed6
当前提交 bfbb2e7938

查看文件

@ -642,29 +642,25 @@ class Logbook extends CI_Controller {
}
}
function search_result($id="") {
function search_result($id="", $id2="") {
$this->load->model('user_model');
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.*');
if ($id2 != "") {
$fixedid = $id . '/' . $id2;
}
$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');
$query = $this->db->get();
$query = $this->querydb($fixedid);
if ($query->num_rows() > 0)
{
if ($query->num_rows() == 0) {
$query = $this->querydb($id);
if ($query->num_rows() > 0) {
$data['results'] = $query;
$this->load->view('view_log/partial/log_ajax.php', $data);
} else {
}
else {
$this->load->model('search');
$iota_search = $this->search->callsign_iota($id);
@ -696,9 +692,24 @@ class Logbook extends CI_Controller {
$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();
}
/*
* Provide a dxcc search, returning results json encoded