mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix lookup syntax
This commit is contained in:
@@ -135,7 +135,13 @@ function GenGroupSQL($pattern, $search='',$extra=0) {
|
||||
if ($extra === 1) {
|
||||
$sql_extra = ",`devices`.*";
|
||||
}
|
||||
$sql = 'SELECT DISTINCT('.str_replace('(', '', $tables[0]).'.device_id)'.$sql_extra.' FROM '.implode(',', $tables).' WHERE ('.$join.''.str_replace("(","",$tables[0]).'.device_id = ?) && '.$search.' ('.str_replace(array('%', '@', '!~', '~'), array('', '.*', 'NOT REGEXP', 'REGEXP'), $pattern).')';
|
||||
if (!empty($search)) {
|
||||
$search = str_replace("(","",$tables[0]).'.'.$search;
|
||||
}
|
||||
if (!empty($join)) {
|
||||
$join = '('.rtrim($join, ' && ').') &&';
|
||||
}
|
||||
$sql = 'SELECT DISTINCT('.str_replace('(', '', $tables[0]).'.device_id)'.$sql_extra.' FROM '.implode(',', $tables).' WHERE '.$join.' '.$search.' ('.str_replace(array('%', '@', '!~', '~'), array('', '.*', 'NOT REGEXP', 'REGEXP'), $pattern).')';
|
||||
return $sql;
|
||||
|
||||
}//end GenGroupSQL()
|
||||
|
Reference in New Issue
Block a user