mirror of
https://github.com/magicbug/Cloudlog
synced 2026-08-13 17:49:35 -04:00
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:
parent
0704b2914a
commit
a59bf0ce35
1 changed files with 2 additions and 2 deletions
|
|
@ -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'] . "')";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue