Fix SQL query to use 'in' for station_id comparison

Updated the SQL query to use 'station_id in (...)' instead of 'station_id = ...' in the subquery, ensuring correct filtering when multiple station IDs are provided.
This commit is contained in:
Peter Goodhall 2026-01-13 10:45:52 +00:00
parent 0704b2914a
commit a59bf0ce35

View file

@ -163,8 +163,8 @@ class IOTA extends CI_Model {
join iota on thcv.col_iota = iota.tag
where station_id in (" . $location_list .
") and thcv.col_iota is not null
and not exists (select 1 from ". $this->config->item('table_name') . " where station_id = ". $location_list .
" and col_iota = thcv.col_iota";
and not exists (select 1 from ". $this->config->item('table_name') . " where station_id in (" . $location_list . ")
and col_iota = thcv.col_iota";
if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";