added logbook filter to simple and advanced search

这个提交包含在:
Thomas Werzmirzowsky 2022-01-09 12:09:35 +01:00
父节点 c8f16d1a06
当前提交 90340a5188
共有 3 个文件被更改,包括 24 次插入8 次删除

查看文件

@ -190,8 +190,8 @@ class Logbook extends CI_Controller {
return false; return false;
$CI =& get_instance(); $CI =& get_instance();
$CI->load->model('logbooks_model'); $CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if(!empty($logbooks_locations_array)) { if(!empty($logbooks_locations_array)) {
if($type == "SAT") { if($type == "SAT") {
@ -311,8 +311,8 @@ class Logbook extends CI_Controller {
]; ];
$CI =& get_instance(); $CI =& get_instance();
$CI->load->model('logbooks_model'); $CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if(!empty($logbooks_locations_array)) { if(!empty($logbooks_locations_array)) {
if($type == "SAT") { if($type == "SAT") {
@ -567,15 +567,20 @@ class Logbook extends CI_Controller {
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.*'); $CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->db->from($this->config->item('table_name')); //$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.*');
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_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->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_GRIDSQUARE', $id);
$this->db->or_like(''.$this->config->item('table_name').'.COL_VUCC_GRIDS', $id); $this->db->or_like(''.$this->config->item('table_name').'.COL_VUCC_GRIDS', $id);
$this->db->group_end();
$this->db->where_in(''.$this->config->item('table_name').'.station_id', $logbooks_locations_array);
$this->db->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', 'desc'); $this->db->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', 'desc');
$query = $this->db->get(); $query = $this->db->get();

查看文件

@ -262,10 +262,16 @@ class Search extends CI_Controller {
} }
function fetchQueryResult($json, $returnquery) { function fetchQueryResult($json, $returnquery) {
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$search_items = json_decode($json, true); $search_items = json_decode($json, true);
$this->db->group_start();
$this->buildWhere($search_items); $this->buildWhere($search_items);
$this->db->group_end();
$this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array);
$this->db->order_by('COL_TIME_ON', 'DESC'); $this->db->order_by('COL_TIME_ON', 'DESC');
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');

查看文件

@ -3,7 +3,12 @@
class Search extends CI_Model { class Search extends CI_Model {
function callsign_iota($reference) { function callsign_iota($reference) {
$CI =& get_instance();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->db->where('COL_IOTA', $reference); $this->db->where('COL_IOTA', $reference);
$this->db->where_in('station_id', $logbooks_locations_array);
$query = $this->db->get($this->config->item('table_name')); $query = $this->db->get($this->config->item('table_name'));
return $query; return $query;