Merge pull request #1993 from phl0/sortStats

Sort SAT amd mode stats by count DESC
pull/1994/head
Peter Goodhall 2023-02-09 12:17:54 +00:00 zatwierdzone przez GitHub
commit 444728b79c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -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');

Wyświetl plik

@ -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'));