Исправлена передача изменений по клиентам, отсутствующим в Bitrix (#360)
This commit is contained in:
parent
1b64044013
commit
169509c263
@ -1,3 +1,6 @@
|
||||
## 2024-09-02 v.6.5.27
|
||||
- Исправлена передача изменений по клиентам, отсутствующим в Bitrix
|
||||
|
||||
## 2024-08-26 v.6.5.26
|
||||
- Исправлено удаление модуля
|
||||
|
||||
|
@ -221,6 +221,36 @@ class CustomerBuilder extends AbstractBuilder implements RetailcrmBuilderInterfa
|
||||
$this->customer->setSubscribe('N');
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->dataCrm['externalId'])
|
||||
&& (empty($this->dataCrm['firstName'])
|
||||
|| empty($this->dataCrm['email']))
|
||||
) {
|
||||
$api = new RetailCrm\ApiClient(RetailcrmConfigProvider::getApiUrl(), RetailcrmConfigProvider::getApiKey());
|
||||
$customerResponse = RCrmActions::apiMethod($api, 'customersGetById', __METHOD__, $this->dataCrm['id']);
|
||||
|
||||
if ($customerResponse instanceof RetailCrm\Response\ApiResponse
|
||||
&& $customerResponse->isSuccessful()
|
||||
&& !empty($customerResponse['customer'])
|
||||
) {
|
||||
$crmCustomer = $customerResponse['customer'];
|
||||
|
||||
if (empty($this->dataCrm['email'])
|
||||
&& !empty($crmCustomer['email'])
|
||||
) {
|
||||
$email = $crmCustomer['email'];
|
||||
|
||||
$this->customer->setEmail($this->fromJSON($email));
|
||||
$this->customer->setLogin($email);
|
||||
}
|
||||
|
||||
if (empty($this->dataCrm['firstName'])
|
||||
&& !empty($crmCustomer['firstName'])
|
||||
) {
|
||||
$this->customer->setName($this->fromJSON($crmCustomer['firstName']));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function buildPassword()
|
||||
|
@ -1 +1 @@
|
||||
- Исправлено удаление модуля
|
||||
- Исправлена передача изменений по клиентам, отсутствующим в Bitrix
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$arModuleVersion = [
|
||||
'VERSION' => '6.5.26',
|
||||
'VERSION_DATE' => '2024-08-26 17:30:00'
|
||||
'VERSION' => '6.5.27',
|
||||
'VERSION_DATE' => '2024-09-02 10:00:00'
|
||||
];
|
||||
|
Loading…
Reference in New Issue
Block a user