Commit 500ea723 authored by Ruslan Kabalin's avatar Ruslan Kabalin Committed by Francois Marier
Browse files

Removed SQL subqueries from search_group function.


Signed-off-by: default avatarRuslan Kabalin <ruslan.kabalin@luns.net.uk>
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent 97525515
......@@ -530,21 +530,15 @@ class PluginSearchInternal extends PluginSearch {
) AND deleted = 0 ";
$values = array($query_string, $query_string);
if (!$grouproles = join(',', array_keys($USER->get('grouproles')))) {
$grouproles = '-1';
}
if ($type == 'member') {
$sql .= 'AND (
id IN (
SELECT "group" FROM {group_member} WHERE member = ?
)
)';
$values[] = $USER->get('id');
$sql .= 'AND id IN (' . $grouproles . ')';
}
else if ($type == 'notmember') {
$sql .= 'AND (
id NOT IN (
SELECT "group" FROM {group_member} WHERE member = ?
)
)';
$values[] = $USER->get('id');
$sql .= 'AND id NOT IN (' . $grouproles . ')';
}
$count = get_field_sql('SELECT COUNT(*) '.$sql, $values);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment