Removed redundant duplicate check under search

This commit is contained in:
Andreas
2024-01-31 08:51:56 +01:00
parent 81fa854494
commit e0a287e168
9 changed files with 2 additions and 184 deletions

View File

@@ -138,7 +138,7 @@ class Logbook extends CI_Controller {
$return['dxcc'] = $this->dxcheck($callsign);
$lookupcall=$this->get_plaincall($callsign);
$return['partial'] = $this->partial($lookupcall);
$callbook = $this->logbook_model->loadCallBook($callsign, $this->config->item('use_fullname'));
@@ -1012,39 +1012,6 @@ class Logbook extends CI_Controller {
return $this->db->get();
}
function search_duplicates($station_id) {
$station_id = $this->security->xss_clean($station_id);
$this->load->model('user_model');
if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; }
$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;
}
$location_list = "'".implode("','",$logbooks_locations_array)."'";
$sql = 'select count(*) as occurence, COL_CALL, COL_MODE, COL_SUBMODE, station_callsign, COL_SAT_NAME, COL_BAND, min(col_time_on) Mintime, max(col_time_on) Maxtime from ' . $this->config->item('table_name') .
' join station_profile on ' . $this->config->item('table_name') . '.station_id = station_profile.station_id where ' . $this->config->item('table_name') .'.station_id in ('. $location_list . ')';
if ($station_id != 'All') {
$sql .= ' and station_profile.station_id = ' . $station_id;
}
$sql .= ' group by col_call, col_mode, COL_SUBMODE, STATION_CALLSIGN, col_band, COL_SAT_NAME having count(*) > 1 and timediff(maxtime, mintime) < 3000';
$query = $this->db->query($sql);
$data['qsos'] = $query;
$this->load->view('search/duplicates_result.php', $data);
}
function search_lotw_unconfirmed($station_id) {
$station_id = $this->security->xss_clean($station_id);