diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c5cfe0a..0b505f95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2023-08-22 v.6.4.1 +- Исправлена передача даты регистрации клиента + ## 2023-08-22 v.6.4.0 - Добавлена функция подписки на рекламно-информационные рассылки diff --git a/intaro.retailcrm/description.ru b/intaro.retailcrm/description.ru index 58155e93..ec98d01d 100644 --- a/intaro.retailcrm/description.ru +++ b/intaro.retailcrm/description.ru @@ -1 +1 @@ -- Добавлена функция подписки на рекламно-информационные рассылки +- Исправлена передача даты регистрации клиента \ No newline at end of file diff --git a/intaro.retailcrm/install/version.php b/intaro.retailcrm/install/version.php index 38bb6f73..f76c8911 100644 --- a/intaro.retailcrm/install/version.php +++ b/intaro.retailcrm/install/version.php @@ -1,6 +1,6 @@ '6.4.0', - 'VERSION_DATE' => '2023-08-22 13:00:00' + 'VERSION' => '6.4.1', + 'VERSION_DATE' => '2023-08-22 9:30:00' ]; diff --git a/intaro.retailcrm/lib/model/bitrix/user.php b/intaro.retailcrm/lib/model/bitrix/user.php index 1fb2ae11..205b9d71 100644 --- a/intaro.retailcrm/lib/model/bitrix/user.php +++ b/intaro.retailcrm/lib/model/bitrix/user.php @@ -68,7 +68,7 @@ class User extends AbstractSerializableModel /** * @var \DateTime|null * - * @Mapping\Type("DateTime<'m.d.Y H:i:s'>") + * @Mapping\Type("DateTime<'d.m.Y H:i:s'>") * @Mapping\SerializedName("DATE_REGISTER") */ private $dateRegister; @@ -85,7 +85,7 @@ class User extends AbstractSerializableModel /** * @var \DateTime * - * @Mapping\Type("DateTime<'m.d.Y H:i:s'>") + * @Mapping\Type("DateTime<'d.m.Y H:i:s'>") * @Mapping\SerializedName("LAST_LOGIN") */ private $lastLogin; @@ -102,7 +102,7 @@ class User extends AbstractSerializableModel /** * @var \DateTime * - * @Mapping\Type("DateTime<'m.d.Y H:i:s'>") + * @Mapping\Type("DateTime<'d.m.Y H:i:s'>") * @Mapping\SerializedName("LAST_ACTIVITY_DATE") */ private $lastActivityDate; @@ -110,7 +110,7 @@ class User extends AbstractSerializableModel /** * @var \DateTime * - * @Mapping\Type("DateTime<'m.d.Y H:i:s'>") + * @Mapping\Type("DateTime<'d.m.Y H:i:s'>") * @Mapping\SerializedName("TIMESTAMP_X") */ private $timestampX; diff --git a/tests/lib/service/CustomerServiceTest.php b/tests/lib/service/CustomerServiceTest.php new file mode 100644 index 00000000..4a22bd04 --- /dev/null +++ b/tests/lib/service/CustomerServiceTest.php @@ -0,0 +1,41 @@ +customerService = new CustomerService(); + } + + public function testCreateModel() + { + $user = new CUser; + $arUser = $user->Register( + 'TestLogin', + 'TestName', + 'TestLastName', + 'TestPassword', + 'TestPassword', + 'testemail@gmail.com' + ); + + $customer = $this->customerService->createModel($arUser['ID']); + $fields = CUser::GetByID($arUser['ID'])->Fetch(); + $dateRegister = new DateTimeImmutable($fields['DATE_REGISTER']); + + self::assertEquals($dateRegister->getTimestamp(), $customer->createdAt->getTimestamp()); + CUser::Delete($arUser['ID']); + } +}