From 970685f0c968af7098864cdacfc70f1eb81982a4 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 22 Dec 2024 08:45:48 +0100 Subject: [PATCH] Query fix on not worked --- application/models/Wae.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/models/Wae.php b/application/models/Wae.php index 094ae0a2e..1a5e3cd74 100644 --- a/application/models/Wae.php +++ b/application/models/Wae.php @@ -368,7 +368,12 @@ class WAE extends CI_Model { $bindings[]=$postdata['mode']; } - $sql .= " and not exists (select 1 from ".$this->config->item('table_name')." where station_id in (". $location_list .") and col_dxcc = thcv.col_dxcc and col_dxcc > 0"; + $sql .= " and not exists (select 1 from ".$this->config->item('table_name')." where station_id in (". $location_list .") and col_dxcc = thcv.col_dxcc"; + if ($wae) { + $sql .= ' and col_dxcc in ( '. $this->waecountries . ') and col_region in ('. $this->region.')'; + } else { + $sql .= " and col_dxcc in ( ". $this->eucountries . ") and coalesce(col_region, '') = ''"; + } $sql .= $this->genfunctions->addBandToQuery($postdata['band'],$bindings);