diff --git a/application/controllers/Statistics.php b/application/controllers/Statistics.php index 9d187b13..e34801ef 100644 --- a/application/controllers/Statistics.php +++ b/application/controllers/Statistics.php @@ -104,6 +104,7 @@ class Statistics extends CI_Controller { $modestats[$i++]['total'] = $this->logbook_model->total_fm(); $modestats[$i]['mode'] = 'digi'; $modestats[$i]['total'] = $this->logbook_model->total_digi(); + usort($modestats, fn($a, $b) => $b['total'] <=> $a['total']); header('Content-Type: application/json'); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 1ca2f4da..919cb224 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1624,6 +1624,7 @@ class Logbook_model extends CI_Model { $this->db->where_in('station_id', $logbooks_locations_array); $this->db->where('COL_SAT_NAME is not null'); $this->db->where('COL_SAT_NAME !=', ''); + $this->db->order_by('count DESC'); $this->db->group_by('COL_SAT_NAME'); $query = $this->db->get($this->config->item('table_name'));