diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index ac5610774..1baa078cf 100644 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -570,12 +570,12 @@ class Logbook_model extends CI_Model { $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $this->db->select($this->config->item('table_name').'.*, `station_profile`.*, `dxcc_entities`.*, `lotw_users`.*, `satellite.displayname` AS sat_displayname'); + $this->db->select($this->config->item('table_name').'.*, `station_profile`.*, `dxcc_entities`.*, `lotw_users`.*, `satellite`.`displayname` AS sat_displayname, satellite.name AS sat_name'); $this->db->join('station_profile', 'station_profile.station_id = ' . $this->config->item('table_name') . '.station_id'); $this->db->join('dxcc_entities', 'dxcc_entities.adif = ' . $this->config->item('table_name') . '.COL_DXCC', 'left outer'); $this->db->join('lotw_users', 'lotw_users.callsign = ' . $this->config->item('table_name') . '.col_call', 'left outer'); if (isset($sat) || strtoupper($band) == 'ALL' || $band == 'SAT' && ($type == 'VUCC' || $type == 'DXCC' || $type == 'DXCC2')) { - $this->db->join('satellite', 'satellite.name = ' . $this->config->item('table_name') . '.col_sat_name', 'left outer'); + $this->db->join('satellite', 'col_prop_mode="SAT" AND col_sat_name = COALESCE(NULLIF(satellite.name, ""), NULLIF(satellite.displayname, ""))', 'left outer'); } switch ($type) { case 'CALL': diff --git a/application/models/Stats.php b/application/models/Stats.php index 4fe54489e..b264aa47b 100644 --- a/application/models/Stats.php +++ b/application/models/Stats.php @@ -1075,7 +1075,7 @@ public function sat_qsos($sat,$dateFrom,$dateTo,$mode) { $this->load->model('logbooks_model'); $logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $this->db->select('*, satellite.displayname AS sat_displayname'); + $this->db->select('*, satellite.displayname AS sat_displayname, satellite.name AS sat_name'); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); $this->db->join('satellite', 'COALESCE(NULLIF(satellite.name, ""), satellite.displayname) = '.$this->config->item('table_name').'.COL_SAT_NAME'); $this->db->join('dxcc_entities', $this->config->item('table_name') . '.col_dxcc = dxcc_entities.adif', 'left outer');