Added mode in the result table

This commit is contained in:
Andreas Kristiansen
2025-05-27 07:54:42 +02:00
parent 6e56f30588
commit 8ef96a5318
2 changed files with 37 additions and 3 deletions

View File

@@ -929,6 +929,40 @@
return null;
}
$sql = "select thcv.col_call, thcv.col_time_on, thcv.col_band, thcv.col_mode, thcv.col_submode, thcv.col_primary_key FROM ". $this->config->item('table_name') . " thcv";
$sql .= " join (SELECT col_call, min(col_time_on) firstworked, col_band, min(col_primary_key) qsoid FROM ".$this->config->item('table_name');
$sql .= " where station_id in (" . implode(',',$logbooks_locations_array) . ") and col_prop_mode ='EME'";
if ($mode != 'All') {
$sql .= " and (col_mode = ? or col_submode = ?)";
$binding[] = $mode;
$binding[] = $mode;
}
if ($band != 'All') {
$sql .= " and col_band = ?";
$binding[] = $band;
}
$sql .= " group by col_call, col_band order by firstworked) x on thcv.col_primary_key = x.qsoid";
$result = $this->db->query($sql, $binding);
return $result->result();
}
public function getInitialsFromDb2($band, $mode) {
$binding = [];
$this->load->model('logbooks_model');
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
if (!$logbooks_locations_array) {
return null;
}
$sql = "SELECT col_call, min(col_time_on) firstworked, col_band, min(col_primary_key) qsoid FROM ".$this->config->item('table_name');
$sql .= " where station_id in (" . implode(',',$logbooks_locations_array) . ") and col_prop_mode ='EME'";