$res = \Bitrix\Main\UserTable::getList(array(
'order' => [],
'filter' => $filter,
'select' => array('ID'),
));
while($user = $res->fetch())
{
$result[] = $user["ID"];
}
res = \Bitrix\Main\UserTable::getList(array(
'order' => [],
'filter' => $filter,
'select' => array('ID'),
// TODO
'limit' => 1
));
while($user = $res->fetch())
{
$result[] = $user["ID"];
}