Fix filtering

This commit is contained in:
Isaac Connor 2018-01-25 09:14:09 -05:00
parent c35c9c4083
commit 57bae7cf17
2 changed files with 2 additions and 2 deletions

View File

@ -249,7 +249,7 @@ $group_options[$Group->Id()] = str_repeat( ' ', $depth ) . $Group->Name();
$MonitorIds = array_merge( $MonitorIds, dbFetchAll( 'SELECT MonitorId FROM Groups_Monitors WHERE GroupId IN (SELECT Id FROM Groups WHERE ParentId = ?)', 'MonitorId', array($group_id) ) );
}
$groupSql = " find_in_set( Id, '".implode( ',', $MonitorIds )."' )";
$groupSql = " find_in_set( M.Id, '".implode( ',', $MonitorIds )."' )";
}
return $groupSql;
} # end public static function get_group_sql( $group_id )

View File

@ -85,7 +85,7 @@ if ( ! is_array( $selected_monitor_ids ) ) {
} # end foreach filter
if ( ! empty( $user['MonitorIds'] ) ) {
$ids = explode(',', $user['MonitorIds'] );
$conditions[] = 'Id IN ('.implode(',',array_map( function(){return '?';}, $ids) ).')';
$conditions[] = 'M.Id IN ('.implode(',',array_map( function(){return '?';}, $ids) ).')';
$values += $ids;
}