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