From: Vladimir Fomichev Date: Mon, 26 Jan 2026 07:01:33 +0000 (+0300) Subject: Убираем X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=50562208a34597c334ff300d91050fa5ec9f877c;p=erp24_rep%2Fyii-erp24%2F.git Убираем --- diff --git a/erp24/.env.example b/erp24/.env.example index 8d1a541b..50f922a3 100644 --- a/erp24/.env.example +++ b/erp24/.env.example @@ -38,6 +38,7 @@ TELEGRAM_ORDER_CONTROL_CHAT_ID_DEV=-1001861631125 TELEGRAM_ORDER_CONTROL_CHAT_ID_PROD= # Email получатели (через запятую) ORDER_CONTROL_EMAIL_RECIPIENTS=ekaterina.geldak@bazacvetov24.ru,irina.rogacheva@bazacvetov24.ru,alena.chelyshkina@bazacvetov24.ru +ORDER_CONTROL_EMAIL_RECIPIENTS_TEST=vladimir.fomichev@erp-flowers.ru,aleksey.filippov@erp-flowers.ru # === DATABASE: PostgreSQL (Primary) === # For Docker: use container name (e.g., db-pgsql-yii_erp24) @@ -244,3 +245,4 @@ MYSQL_TEST_HOST=127.0.0.1 MYSQL_TEST_USER= MYSQL_TEST_PASSWORD= MYSQL_TEST_DB=erp24_api_test + diff --git a/erp24/config/console.php b/erp24/config/console.php index 96f09ea3..e5a0fd27 100755 --- a/erp24/config/console.php +++ b/erp24/config/console.php @@ -67,7 +67,7 @@ $config = [ '%s://%s:%s@%s:%d', getenv('MAIL_SCHEME') ?: 'smtps', rawurlencode(getenv('MAIL_USERNAME') ?: 'flow@bazacvetov24.ru'), - rawurlencode(getenv('MAIL_PASSWORD') ?: 'ctqamxqeshgxwsgn'), + rawurlencode(getenv('MAIL_PASSWORD') ?: ''), getenv('MAIL_HOST') ?: 'smtp.yandex.ru', (int)(getenv('MAIL_PORT') ?: 465) ), diff --git a/erp24/config/params.php b/erp24/config/params.php index bf489763..35024f8f 100644 --- a/erp24/config/params.php +++ b/erp24/config/params.php @@ -30,8 +30,8 @@ return [ 'telegram_chat_id_dev' => getenv('TELEGRAM_ORDER_CONTROL_CHAT_ID_DEV') ?: '-1001861631125', 'telegram_chat_id_prod' => getenv('TELEGRAM_ORDER_CONTROL_CHAT_ID_PROD') ?: '4886272326', // Email получатели по ТЗ - 'email_recipients' => array_filter(explode(',', getenv('ORDER_CONTROL_EMAIL_RECIPIENTS') ?: 'vladimir.fomichev@erp-flowers.ru,aleksey.filippov@erp-flowers.ru')), - //'email_recipients' => array_filter(explode(',', getenv('ORDER_CONTROL_EMAIL_RECIPIENTS') ?: 'ekaterina.geldak@bazacvetov24.ru,irina.rogacheva@bazacvetov24.ru,alena.chelyshkina@bazacvetov24.ru')), + 'email_recipients_test' => array_filter(explode(',', getenv('ORDER_CONTROL_EMAIL_RECIPIENTS_TEST') ?: 'vladimir.fomichev@erp-flowers.ru,aleksey.filippov@erp-flowers.ru')), + 'email_recipients' => array_filter(explode(',', getenv('ORDER_CONTROL_EMAIL_RECIPIENTS') ?: 'ekaterina.geldak@bazacvetov24.ru,irina.rogacheva@bazacvetov24.ru,alena.chelyshkina@bazacvetov24.ru')), 'email_subject' => '[Контроль MP] Отчёт о расхождениях статусов заказов', ], ]; diff --git a/erp24/config/web.php b/erp24/config/web.php index 40316554..c85f05ce 100644 --- a/erp24/config/web.php +++ b/erp24/config/web.php @@ -80,7 +80,7 @@ $config = [ '%s://%s:%s@%s:%d', getenv('MAIL_SCHEME') ?: 'smtps', rawurlencode(getenv('MAIL_USERNAME') ?: 'flow@bazacvetov24.ru'), - rawurlencode(getenv('MAIL_PASSWORD') ?: 'ctqamxqeshgxwsgn'), + rawurlencode(getenv('MAIL_PASSWORD') ?: ''), getenv('MAIL_HOST') ?: 'smtp.yandex.ru', (int)(getenv('MAIL_PORT') ?: 465) ), diff --git a/erp24/services/OrderControlReportService.php b/erp24/services/OrderControlReportService.php index 4d3a9688..693ad846 100644 --- a/erp24/services/OrderControlReportService.php +++ b/erp24/services/OrderControlReportService.php @@ -1411,14 +1411,21 @@ class OrderControlReportService /** * Получает список email-получателей * + * В dev-окружении используются тестовые адреса (email_recipients_test), + * в prod-окружении - основные адреса (email_recipients). + * * @return array */ private function getEmailRecipients(): array { - $recipients = $this->config['email_recipients'] ?? []; + // Выбираем ключ конфига в зависимости от окружения + $configKey = TelegramService::isDevEnv() ? 'email_recipients_test' : 'email_recipients'; + $envKey = TelegramService::isDevEnv() ? 'ORDER_CONTROL_EMAIL_RECIPIENTS_TEST' : 'ORDER_CONTROL_EMAIL_RECIPIENTS'; + + $recipients = $this->config[$configKey] ?? []; if (empty($recipients)) { - $envRecipients = getenv('ORDER_CONTROL_EMAIL_RECIPIENTS'); + $envRecipients = getenv($envKey); if ($envRecipients) { $recipients = array_filter(explode(',', $envRecipients)); }