Neur0toxine
5f69051859
* New module structure (refactoring) * Simple serializer and deserializer with models, new architecture * Move logic to strategies * Partial api client facade implementation (full implementation is not necessary for now) * Loyalty feature installer * Sms verification order (#167) * Make updater self-sufficient * Fix for order submit & fix for incorrect component rendering in the constructor * Fix for loyalty personal area error handling * Fix for cart component identity * Fix for softlock when customer cannot be registered in loyalty Co-authored-by: Сергей Чазов <45812598+Chazovs@users.noreply.github.com> Co-authored-by: Sergey Chazov <oitv18@gmail.com>
43 lines
984 B
PHP
43 lines
984 B
PHP
<?php
|
|
|
|
/**
|
|
* Class RetailUser
|
|
*/
|
|
class RetailUser extends CUser
|
|
{
|
|
/**
|
|
* @return int|mixed|string|null
|
|
*/
|
|
public function GetID()
|
|
{
|
|
$rsUser = CUser::GetList(($by = 'ID'), ($order = 'DESC'), ['LOGIN' => 'retailcrm']);
|
|
|
|
if ($arUser = $rsUser->Fetch()) {
|
|
return $arUser['ID'];
|
|
}
|
|
|
|
$retailUser = new CUser;
|
|
$userPassword = uniqid();
|
|
|
|
$arFields = [
|
|
'NAME' => 'retailcrm',
|
|
'LAST_NAME' => 'retailcrm',
|
|
'EMAIL' => 'retailcrm@retailcrm.com',
|
|
'LOGIN' => 'retailcrm',
|
|
'LID' => 'ru',
|
|
'ACTIVE' => 'Y',
|
|
'GROUP_ID' => [2],
|
|
'PASSWORD' => $userPassword,
|
|
'CONFIRM_PASSWORD' => $userPassword,
|
|
];
|
|
|
|
$id = $retailUser->Add($arFields);
|
|
|
|
if (!$id) {
|
|
return null;
|
|
}
|
|
|
|
return $id;
|
|
}
|
|
}
|