From: fomichev Date: Fri, 10 Jan 2025 07:12:38 +0000 (+0300) Subject: Добавление статуса покупки X-Git-Tag: 1.7~89^2~4 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=b7a50751b010a7fbcee1b0e2f4b37d767e3bbcfb;p=erp24_rep%2Fyii-erp24%2F.git Добавление статуса покупки --- 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); }