Skip to content

Commit

Permalink
Merge pull request #1959 from magicbug/dev
Browse files Browse the repository at this point in the history
Fixes issue with dashboard dates being out of order
  • Loading branch information
magicbug authored Jan 27, 2023
2 parents bfa4851 + 348342d commit ef143e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions application/models/Logbook_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,7 @@ function get_qsos($num, $offset, $StationLocationsArray = null) {
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
$this->db->where_in('station_profile.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_PRIMARY_KEY', "desc");

$this->db->limit($num);
$this->db->offset($offset);
Expand Down Expand Up @@ -1179,11 +1180,12 @@ function get_last_qsos($num, $StationLocationsArray = null) {

$sql = "SELECT * FROM ( select * from " . $this->config->item('table_name'). "
WHERE station_id IN(". $location_list .")
order by col_time_on desc
order by col_time_on desc, col_primary_key desc
limit " . $num .
") hrd
JOIN station_profile ON station_profile.station_id = hrd.station_id
LEFT JOIN dxcc_entities ON hrd.col_dxcc = dxcc_entities.adif";
LEFT JOIN dxcc_entities ON hrd.col_dxcc = dxcc_entities.adif
order by col_time_on desc, col_primary_key desc";

$query = $this->db->query($sql);

Expand Down
4 changes: 2 additions & 2 deletions application/models/Logbookadvanced_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function searchQsos($searchCriteria) : array {
INNER JOIN station_profile ON qsos.station_id=station_profile.station_id
WHERE station_profile.user_id = ?
$where
ORDER BY qsos.COL_TIME_ON desc
ORDER BY qsos.COL_TIME_ON desc, qsos.COL_PRIMARY_KEY desc
LIMIT $limit
";

Expand Down Expand Up @@ -217,4 +217,4 @@ function get_modes() {

return $modes;
}
}
}

0 comments on commit ef143e1

Please sign in to comment.