From 54c671d816aae478fbb3ccb07a08a827342f6934 Mon Sep 17 00:00:00 2001 From: fomichev Date: Thu, 9 Jan 2025 12:59:36 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BF=D0=B8=D1=81=D1=8B?= =?utf8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE?= =?utf8?q?=D1=81=D0=B0=20=D0=BF=D0=B0=D0=BC=D1=8F=D1=82=D0=BD=D0=BE=D0=B3?= =?utf8?q?=D0=BE=20=D1=81=D0=BE=D0=B1=D1=8B=D1=82=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/records/Users.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/erp24/records/Users.php b/erp24/records/Users.php index f925b2d2..9fb1d708 100755 --- a/erp24/records/Users.php +++ b/erp24/records/Users.php @@ -595,6 +595,11 @@ class Users extends \yii\db\ActiveRecord }, $phones); } + $targetDate = SentKogort::find() + ->where(['kogort_date' => $startDate, 'kogort_number' => SentKogort::KOGORT_NUMBERS[$type]]) + ->select(['target_date']) + ->one(); + $salesData = Sales::find() ->select([ 'phone', @@ -611,7 +616,9 @@ class Users extends \yii\db\ActiveRecord $memorableDates = UsersEvents::find() ->select(['phone']) ->where(['phone' => $phones]) - ->distinct() + ->andWhere(['date_month' => (int)date('m', strtotime($targetDate['target_date'])), + 'date_day' => (int)date('d', strtotime($targetDate['target_date']))]) + ->distinct('phone') ->asArray() ->indexBy('phone') ->all(); -- 2.39.5