diff --git a/application/models/Timeline_model.php b/application/models/Timeline_model.php index e2f2bc58b..0a8f03992 100644 --- a/application/models/Timeline_model.php +++ b/application/models/Timeline_model.php @@ -230,8 +230,11 @@ class Timeline_model extends CI_Model { public function get_timeline_waz($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) { $binding = []; - $sql = "select min(date(COL_TIME_ON)) date, col_cqz from " - .$this->config->item('table_name'). " thcv + $sql = "SELECT * FROM ("; + $sql .= "SELECT COL_TIME_ON AS date, col_cqz, "; + $sql .= "COL_SAT_NAME AS sat_name, "; + $sql .= "ROW_NUMBER() OVER (PARTITION BY col_cqz ORDER BY COL_TIME_ON ASC) AS rn "; + $sql .= "FROM ".$this->config->item('table_name'). " thcv where station_id in (" . $location_list . ")"; if ($band == 'SAT') { // Left for compatibility reasons @@ -268,8 +271,10 @@ class Timeline_model extends CI_Model { $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz); - $sql .= " and col_cqz <> '' group by col_cqz - order by date desc"; + $sql .= " and col_cqz <> ''"; + $sql .= ") ranked "; + $sql .= "WHERE rn = 1 "; + $sql .= "ORDER BY date DESC;"; $query = $this->db->query($sql, $binding); diff --git a/application/views/timeline/index.php b/application/views/timeline/index.php index c58a85e86..e03142961 100644 --- a/application/views/timeline/index.php +++ b/application/views/timeline/index.php @@ -336,8 +336,11 @@ function write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $ # '.__("Date").' - '.__("CQ Zone").' - '.__("Show QSOs").' + '.__("CQ Zone").''; + if ($propmode == 'SAT' || $propmode == 'All') { + echo ' '.__("Satellite").''; + } + echo ' '.__("Show QSOs").' '; @@ -348,8 +351,11 @@ function write_waz_timeline($timeline_array, $custom_date_format, $bandselect, $ echo ' ' . $i-- . ' ' . date($custom_date_format, $date_as_timestamp) . ' - ' . $line->col_cqz . ' - col_cqz . '","'. $bandselect . '","'. $modeselect. '","' . $propmode . '","' . $award .'")>'.__("Show").' + ' . $line->col_cqz . ''; + if ($propmode == 'SAT' || $propmode == 'All') { + echo '' . $line->sat_name . ''; + } + echo ' col_cqz . '","'. $bandselect . '","'. $modeselect. '","' . $propmode . '","' . $award .'")>'.__("Show").' '; } echo '';