Skip to content

Instantly share code, notes, and snippets.

@s2ar
Created August 10, 2017 08:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s2ar/7ed5af78f6f144a16f0bb8723c850d80 to your computer and use it in GitHub Desktop.
Save s2ar/7ed5af78f6f144a16f0bb8723c850d80 to your computer and use it in GitHub Desktop.
d7_user_simple.php
<?php
// Найдем пользователей с пустым guid с регистрацией не больше месяца
$objDateTime = new \Bitrix\Main\Type\DateTime();
$objDateTime->add("-1 months");
$arFilter = Array(
"UF_GUID"=>'',
">DATE_REGISTER"=> $objDateTime,
"LOGIN" =>"+%"
);
$resUser = Bitrix\Main\UserTable::getList(Array(
"select"=>Array("ID","NAME","DATE_REGISTER",'LOGIN'),
"filter"=>$arFilter,
));
while ($arRes = $resUser->fetch()) {
$result = get_client_by_phone($arRes['LOGIN']);
if(isset($result[0]['id']) && !empty($result[0]['id'])){
SetUserField("USER", $arRes['ID'], "UF_GUID", $result[0]['id']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment