0

bitrix как получить ID пользователя зная его e-mail?

1 ответ 1

1
//d7
use Bitrix\Main\UserTable;

$user = UserTable::getList([
    'select' => [
        'ID'
    ],
    'filter' => [
        'EMAIL' => 'user@mail'
    ]
])->fetch();

echo $user['ID'];

//old
$cUser = $USER::GetList(
    $by="ID",
    $order="desc",
    [
        'EMAIL' => 'user@mail'
    ],
    [
        'SELECT' => [
            'ID'
        ]
    ]
)->fetch();

echo $cUser['ID'];

Более подробно о работе приведенных методов вы можете посмотреть в документации

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.