[SIG Award] Updated code to support station logbooks

这个提交包含在:
Andreas 2021-09-09 22:29:59 +02:00
父节点 a6422fa341
当前提交 5cfa97af8a
共有 3 个文件被更改,包括 17 次插入14 次删除

查看文件

@ -477,7 +477,7 @@ class Awards extends CI_Controller {
ini_set('memory_limit', '-1');
$this->load->model('adif_data');
//$type = str_replace('"', "", $this->input->get("type"));
$type = $this->uri->segment(3);
$data['qsos'] = $this->adif_data->sig_all($type);

查看文件

@ -128,12 +128,13 @@ class adif_data extends CI_Model {
}
function sig_all($type) {
$this->load->model('stations');
$active_station_id = $this->stations->find_active();
$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->select(''.$this->config->item('table_name').'.*, station_profile.*');
$this->db->from($this->config->item('table_name'));
$this->db->where($this->config->item('table_name').'.station_id', $active_station_id);
$this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array);
$this->db->where($this->config->item('table_name').'.COL_SIG', $type);
$this->db->order_by($this->config->item('table_name').".COL_TIME_ON", "ASC");

查看文件

@ -9,10 +9,10 @@ class Sig extends CI_Model {
function get_all($type) {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$this->db->where("station_id", $station_id);
$this->db->where_in("station_id", $logbooks_locations_array);
$this->db->order_by("COL_SIG_INFO", "ASC");
$this->db->where('COL_SIG =', $type);
@ -21,12 +21,14 @@ class Sig extends CI_Model {
function get_all_sig_types() {
$CI =& get_instance();
$CI->load->model('Stations');
$station_id = $CI->Stations->find_active();
$CI->load->model('logbooks_model');
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$sql = "select col_sig, count(*) qsos, count(distinct col_sig_info) refs from " . $this->config->item('table_name') .
" where col_sig <> ''" .
" and station_id = " . $station_id .
" and station_id in (" . $location_list . ")" .
" group by col_sig";
$query = $this->db->query($sql);