Added API call for listing devices by groups

This commit is contained in:
laf
2015-12-12 13:47:44 +00:00
parent 62b4c21a12
commit a73a997edc
4 changed files with 123 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ function GenGroupSQL($pattern, $search='') {
$search .= ' &&';
}
$sql = 'SELECT DISTINCT('.str_replace('(', '', $tables[0]).'.device_id) FROM '.implode(',', $tables).' WHERE '.$search.' ('.str_replace(array('%', '@', '!~', '~'), array('', '.*', 'NOT REGEXP', 'REGEXP'), $pattern).')';
$sql = 'SELECT DISTINCT('.str_replace('(', '', $tables[0]).'.device_id),`devices`.* FROM '.implode(',', $tables).' WHERE '.$search.' ('.str_replace(array('%', '@', '!~', '~'), array('', '.*', 'NOT REGEXP', 'REGEXP'), $pattern).')';
return $sql;
}//end GenGroupSQL()