$arrOrmParams = [
'select' => (array_merge(['ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'PERSONAL_PHOTO'], $arSelect['SELECT'])),
'filter' => [
"Bitrix\Main\UserGroupTable:USER.GROUP_ID" => $arFilter['GROUPS_ID']],
'limit' => $arParams["ITEMS_LIMIT"],
'offset' => 0,
];
if ($arParams["IS_RAND"] == "Y") {
$arrOrmParams['order'] = [
"RAND" => "asc"
];
$arrOrmParams['runtime'] = [new ExpressionField('RAND', 'RAND()')];
}
$rsUsers = UserTable::getList($arrOrmParams);
$arResult['USER'] = $rsUsers->fetchAll();