From: fomichev Date: Fri, 27 Dec 2024 07:02:35 +0000 (+0300) Subject: Правки оптимизации вотсап X-Git-Tag: 1.7~94^2~19 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=7fde817fc4077a2072839a7cb508e3812e7780cf;p=erp24_rep%2Fyii-erp24%2F.git Правки оптимизации вотсап --- diff --git a/erp24/records/Users.php b/erp24/records/Users.php index 2bd28af6..fc5f1264 100755 --- a/erp24/records/Users.php +++ b/erp24/records/Users.php @@ -524,6 +524,7 @@ class Users extends \yii\db\ActiveRecord $excludeRegistered = UsersTelegram::find() ->where(['is_blocked' => 0, 'is_registered' => 1]) + ->andWhere(['phone' => $targetPhones]) ->distinct('phone') ->select('phone') ->column(); @@ -531,6 +532,7 @@ class Users extends \yii\db\ActiveRecord $excludeSalesPhone = Sales::find() ->where(['>=', 'date', date('Y-m-d', strtotime("$startDate -$step1 days"))]) ->andWhere(['<=', 'date', date('Y-m-d', strtotime("$startDate -$step2 days"))]) + ->andWhere(['phone' => $targetPhones]) ->distinct('phone') ->select('phone') ->column();