Answer the question
In order to leave comments, you need to log in
Why are all users included in the sample?
Hello. I want to make a selection of users who are NOT included in certain groups.
Here is my code:
$users = CUser::GetList(['LAST_NAME'=>'asc'],'asc',['!GROUPS_ID'=>[29,35,30,279,34]]);
Answer the question
In order to leave comments, you need to log in
There is a ready-made example in the comments to the off. documentation...
// First, select the user IDs that belong to the group for which you want to make an exception
// At the second step, using complex logic, we will negate the selected user IDs
$rsUsers = CUser::GetList($by = "", $order = "", array("ID" => "~".implode("& ~", $arUsers)));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question