From bb19e33e229623befa9b257670b3996963cb5fd7 Mon Sep 17 00:00:00 2001 From: fomichev Date: Mon, 7 Apr 2025 17:28:58 +0300 Subject: [PATCH] =?utf8?q?=D1=83=D0=B2=D0=B5=D0=B4=D0=BE=D0=BC=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D0=B5=20=D0=B2=20=D1=82=D0=B5=D0=BB=D0=B5=D0=B3?= =?utf8?q?=D1=80=D0=B0=D0=BC=20=D0=BE=D0=B1=20=D0=BE=D1=82=D1=81=D1=83?= =?utf8?q?=D1=82=D1=81=D1=82=D0=B2=D0=B8=D0=B8=20=D0=BC=D0=B0=D0=B3=D0=B0?= =?utf8?q?=D0=B7=D0=B8=D0=BD=D0=B0=20=D0=AF=D0=9C=20=D0=B2=20MarketplaceSt?= =?utf8?q?ore?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/media/config/media.config.php | 23 ++++++++++++++++++++++- erp24/services/MarketplaceService.php | 6 ++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/erp24/media/config/media.config.php b/erp24/media/config/media.config.php index 57f37dc2..d0fcd047 100644 --- a/erp24/media/config/media.config.php +++ b/erp24/media/config/media.config.php @@ -1,5 +1,8 @@ 'ru', 'id' => 'app', @@ -19,6 +22,19 @@ return [ 'timeFormat' => 'php:H:i', 'decimalSeparator' => ',', 'thousandSeparator' => ',', + ], + 'queue' => [ + 'class' => Queue::class, + //'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@rabbitmq-yii_erp24:5672', + 'dsn' => 'amqp://admin:3qqHK2MRgGgxUdVT61@localhost:5672', + 'queueName' => 'telegram-queue', + 'as log' => \yii\queue\LogBehavior::class, + 'ttr' => 300, // Время для выполнения задания + 'attempts' => 3, // Количество попыток + 'exchangeName' => 'telegram-exchange', + + + ], 'urlManager' => [ 'enablePrettyUrl' => true, @@ -63,7 +79,12 @@ return [ 'yii\web\HttpException:403', 'yii\web\HttpException:401', ], - ] + ], + /*[ + 'class' => \app\log\TelegramTarget::class, + 'levels' => ['error', 'warning'], + // 'categories' => ['api.error', 'js.error', 'command.error'], + ],*/ ], ], 'cache' => [ diff --git a/erp24/services/MarketplaceService.php b/erp24/services/MarketplaceService.php index c3608f8b..7a54769d 100644 --- a/erp24/services/MarketplaceService.php +++ b/erp24/services/MarketplaceService.php @@ -1010,6 +1010,12 @@ class MarketplaceService $warehouseGuid = (string)$campaignId; if ($warehouseGuid) { $store = MarketplaceStore::findOne(['warehouse_guid' => $warehouseGuid]); + if (!$store) { + $errorMessage = "Ошибка! Отсутствует запись MarketplaceStore для магазина {$warehouseGuid} ЯМ"; + $errorMessage = TelegramService::escapeMarkdown($errorMessage); + $isDev = TelegramService::isDevEnv(); + TelegramService::sendErrorToTelegramMessage($errorMessage, false, $isDev); + } $marketplaceOrder->store_id = $store ? $store->store_id : null; $marketplaceOrder->warehouse_guid = $warehouseGuid; $marketplaceOrder->marketplace_id = $store->warehouse_id ?? 2; -- 2.39.5