diff --git a/application/models/Timeline_model.php b/application/models/Timeline_model.php index 0a8f03992..6b99d4287 100644 --- a/application/models/Timeline_model.php +++ b/application/models/Timeline_model.php @@ -77,8 +77,11 @@ class Timeline_model extends CI_Model { public function get_timeline_waja($band, $mode, $propmode, $location_list, $qsl, $lotw, $eqsl, $clublog, $year, $qrz, $onlynew) { $binding = []; - $sql = "select min(date(COL_TIME_ON)) date, col_state from " - .$this->config->item('table_name'). " thcv + $sql = "SELECT * FROM ("; + $sql .= "SELECT COL_TIME_ON AS date, col_state, "; + $sql .= "COL_SAT_NAME AS sat_name, "; + $sql .= "ROW_NUMBER() OVER (PARTITION BY COL_STATE 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 @@ -117,8 +120,10 @@ class Timeline_model extends CI_Model { $sql .= $this->addQslToQuery($qsl, $lotw, $eqsl, $clublog, $qrz); - $sql .= " group by col_state - order by date desc"; + $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 e03142961..142430486 100644 --- a/application/views/timeline/index.php +++ b/application/views/timeline/index.php @@ -240,8 +240,11 @@ function write_waja_timeline($timeline_array, $custom_date_format, $bandselect, # '.__("Date").' - '.__("Prefecture").' - '.__("Show QSOs").' + '.__("Prefecture").''; + if ($propmode == 'SAT' || $propmode == 'All') { + echo ' '.__("Satellite").''; + } + echo ' '.__("Show QSOs").' '; @@ -252,8 +255,11 @@ function write_waja_timeline($timeline_array, $custom_date_format, $bandselect, echo ' ' . $i-- . ' ' . date($custom_date_format, $date_as_timestamp) . ' - ' . $CI->Waja->jaPrefectures[$line->col_state] . ' ('.$line->col_state.') - col_state . '","'. $bandselect . '","'. $modeselect. '","' . $propmode . '","' . $award .'")>'.__("Show").' + ' . $CI->Waja->jaPrefectures[$line->col_state] . ' ('.$line->col_state.')'; + if ($propmode == 'SAT' || $propmode == 'All') { + echo ''.$line->sat_name.''; + } + echo ' col_state . '","'. $bandselect . '","'. $modeselect. '","' . $propmode . '","' . $award .'")>'.__("Show").' '; } echo '';