Return IDs set from "get_group_members" function

This commit is contained in:
Dmitriy Simushev 2014-10-30 13:27:23 +00:00
parent 9d854e9642
commit 146c4b7ac1
2 changed files with 9 additions and 6 deletions

View File

@ -63,10 +63,7 @@ class MembersController extends AbstractController
: '';
// Get list of group's members
$checked_operators = array();
foreach (get_group_members($group_id) as $rel) {
$checked_operators[] = $rel['operatorid'];
}
$checked_operators = get_group_members($group_id);
// Prepare the list of all operators
$page['operators'] = array();

View File

@ -431,12 +431,18 @@ function update_group($group)
*/
function get_group_members($group_id)
{
$db = Database::getInstance();
return $db->query(
$rows = Database::getInstance()->query(
"SELECT operatorid FROM {operatortoopgroup} WHERE groupid = ?",
array($group_id),
array('return_rows' => Database::RETURN_ALL_ROWS)
);
$operators = array();
foreach ($rows as $row) {
$operators[] = $row['operatorid'];
}
return $operators;
}
/**