From de2a0ddaa967362bf383da5669cafd2192755982 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 7 Sep 2022 09:44:22 +0200 Subject: [PATCH] [Bands] US Counties support added --- application/models/Counties.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/application/models/Counties.php b/application/models/Counties.php index d30408ed..55a5a8f7 100644 --- a/application/models/Counties.php +++ b/application/models/Counties.php @@ -33,12 +33,19 @@ class Counties extends CI_Model $location_list = "'".implode("','",$logbooks_locations_array)."'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('uscounties'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + $sql = "select count(distinct COL_CNTY) countycountworked, coalesce(x.countycountconfirmed, 0) countycountconfirmed, thcv.COL_STATE from " . $this->config->item('table_name') . " thcv left outer join ( select count(distinct COL_CNTY) countycountconfirmed, COL_STATE from " . $this->config->item('table_name') . " where station_id in (" . $location_list . ")" . + " and col_band in (" . $bandslots_list . ")" . " and COL_DXCC in ('291', '6', '110') and coalesce(COL_CNTY, '') <> '' and COL_BAND != 'SAT' @@ -47,6 +54,7 @@ class Counties extends CI_Model order by COL_STATE ) x on thcv.COL_STATE = x.COL_STATE where station_id in (" . $location_list . ")" . + " and col_band in (" . $bandslots_list . ")" . " and COL_DXCC in ('291', '6', '110') and coalesce(COL_CNTY, '') <> '' and COL_BAND != 'SAT' @@ -85,9 +93,16 @@ class Counties extends CI_Model $location_list = "'".implode("','",$logbooks_locations_array)."'"; + $this->load->model('bands'); + + $bandslots = $this->bands->get_worked_bands('uscounties'); + + $bandslots_list = "'".implode("','",$bandslots)."'"; + $sql = "select distinct COL_CNTY, COL_STATE from " . $this->config->item('table_name') . " thcv where station_id in (" . $location_list . ")" . + " and col_band in (" . $bandslots_list . ")" . " and COL_DXCC in ('291', '6', '110') and coalesce(COL_CNTY, '') <> '' and COL_BAND != 'SAT'";