From d765290ed7645d97359a49384593a3347115fd9f Mon Sep 17 00:00:00 2001 From: fomichev Date: Mon, 21 Apr 2025 13:38:00 +0300 Subject: [PATCH] =?utf8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20=D1=82?= =?utf8?q?=D0=B5=D1=81=D1=82=D0=BE=D0=B2=D1=8B=D0=BC=D0=B8=20=D0=BD=D0=BE?= =?utf8?q?=D0=BC=D0=B5=D1=80=D0=B0=D0=BC=D0=B8=20=D0=BF=D1=80=D0=B8=20?= =?utf8?q?=D1=82=D0=B5=D1=81=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?utf8?q?=D0=B8=D0=B8=20=D1=82=D0=B5=D0=BB=D0=B5=D0=B3=D1=80=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/commands/CronController.php | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/erp24/commands/CronController.php b/erp24/commands/CronController.php index bcf0629a..1fed5bf9 100644 --- a/erp24/commands/CronController.php +++ b/erp24/commands/CronController.php @@ -393,6 +393,18 @@ class CronController extends Controller ->andWhere(['status' => 1]) ->column(); + $testPhones = array_map('trim', explode(',', $messagesSettings->test_phones_list)); + $countTestPhones = count($testPhones); + if (!empty($messagesSettings->test_phones_list)) { + if ( + isset($messagesSettings->test_phones_active) + && + $messagesSettings->test_phones_active == 1 + ) { + $kogortPhones = $testPhones; + } + } + if (!empty($kogortPhones)) { $countPhones = count($kogortPhones); $this->stdout( @@ -479,8 +491,7 @@ class CronController extends Controller ->andWhere(['tip_sale' => 'target']) ->andWhere(['date_start' => $kogortDate]) ->column(); - $testPhones = array_map('trim', explode(',', $messagesSettings->test_phones_list)); - $countTestPhones = count($testPhones); + $countBonuses = 0; foreach ($kogortPhones as $key => $phone) { if (in_array($phone, $testPhones)) { @@ -673,6 +684,17 @@ class CronController extends Controller ->andWhere(['target_date' => $targetDate]) ->andWhere(['purchase' => 0]) ->column(); + $testPhones = array_map('trim', explode(',', $messagesSettings->test_phones_list)); + + if (!empty($messagesSettings->test_phones_list)) { + if ( + isset($messagesSettings->test_phones_active) + && + $messagesSettings->test_phones_active == 1 + ) { + $kogortPhones = $testPhones; + } + } if (!empty($kogortPhones)) { $countPhones = count($kogortPhones); @@ -697,8 +719,6 @@ class CronController extends Controller $toSend = Users::filterTelegramUsersForSending($telegramUsers, $sentStatusKogort); - - $chatIdsArray = array_column($telegramUsers, 'chat_id'); $countTelegramPhones = count($toSend); $this->stdout( "Всего телефонов в рассылке телеграма {$countTelegramPhones} записей.\n", -- 2.39.5