From b7a50751b010a7fbcee1b0e2f4b37d767e3bbcfb Mon Sep 17 00:00:00 2001 From: fomichev Date: Fri, 10 Jan 2025 10:12:38 +0300 Subject: [PATCH] =?utf8?q?=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?utf8?q?=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=D0=B0?= =?utf8?q?=20=D0=BF=D0=BE=D0=BA=D1=83=D0=BF=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/records/Users.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/erp24/records/Users.php b/erp24/records/Users.php index c68c1ae9..936c2ea6 100755 --- a/erp24/records/Users.php +++ b/erp24/records/Users.php @@ -4,6 +4,7 @@ namespace yii_app\records; use Yii; use yii\base\StaticInstanceInterface; +use yii\helpers\BaseConsole; /** * This is the model class for table "users". @@ -529,6 +530,17 @@ class Users extends \yii\db\ActiveRecord ->select('phone') ->column(); + if (!empty($excludeSalesPhone)) { + $updatedCount = SentKogort::updateAll( + ['purchase' => 1], // Устанавливаем покупка + [ + 'target_date' => $targetDate, + 'kogort_number' => SentKogort::KOGORT_NUMBERS['target'], + 'phone' => $excludeSalesPhone, + ] + ); + } + $whatsappPhones = array_diff(array_diff($targetPhones, $excludeRegistered), $excludeSalesPhone); $secondTarget = array_diff($excludeRegistered, $excludeSalesPhone); @@ -554,6 +566,16 @@ class Users extends \yii\db\ActiveRecord ->select('phone') ->column(); + if (!empty($excludeSalesPhone)) { + $updatedCount = SentKogort::updateAll( + ['purchase' => 1], // Устанавливаем покупка + [ + 'target_date' => $targetDate, + 'kogort_number' => SentKogort::KOGORT_NUMBERS['target'], + 'phone' => $excludeSalesPhone, + ] + ); + } return array_diff($whatsappPhones, $excludeSalesPhone); } -- 2.39.5