From: fomichev Date: Mon, 13 Jan 2025 07:55:56 +0000 (+0300) Subject: Исправление выборки номеров для таргет когорты X-Git-Tag: 1.7~67^2~7 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=da082259dab97f9563fb9b632b921e99043b67ee;p=erp24_rep%2Fyii-erp24%2F.git Исправление выборки номеров для таргет когорты --- diff --git a/erp24/records/Users.php b/erp24/records/Users.php index c68c1ae9..a530a3df 100755 --- a/erp24/records/Users.php +++ b/erp24/records/Users.php @@ -459,6 +459,7 @@ class Users extends \yii\db\ActiveRecord $salesPhone = Sales::find() ->where(new \yii\db\Expression("TO_CHAR(date, 'MM-DD') = :monthDay", [':monthDay' => $monthDay])) + ->andWhere(['not', ['phone' => 0]]) ->distinct('phone') ->select('phone') ->column(); @@ -525,6 +526,7 @@ class Users extends \yii\db\ActiveRecord ->where(['>=', 'date', date('Y-m-d', strtotime("$targetDate -$step1 days"))]) ->andWhere(['<=', 'date', date('Y-m-d', strtotime("$targetDate -$step2 days"))]) ->andWhere(['phone' => $targetPhones]) + ->andWhere(['not', ['phone' => 0]]) ->distinct('phone') ->select('phone') ->column(); @@ -550,6 +552,7 @@ class Users extends \yii\db\ActiveRecord ->where(['>=', 'date', date('Y-m-d', strtotime("$targetDate -$step2 days"))]) ->andWhere(['<=', 'date', date('Y-m-d', strtotime("$targetDate -$step3 days"))]) ->andWhere(['phone' => $whatsappPhones]) + ->andWhere(['not', ['phone' => 0]]) ->distinct('phone') ->select('phone') ->column();