From ab92ba7c12df2965e226ba179ba261ab7daf1e78 Mon Sep 17 00:00:00 2001 From: vladfo Date: Thu, 10 Oct 2024 12:10:20 +0300 Subject: [PATCH] =?utf8?q?=D1=81=D0=BC=D0=B5=D0=BD=D0=B0=20date=5Fshift=20?= =?utf8?q?=D0=BD=D0=B0=20date?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/MotivationService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erp24/services/MotivationService.php b/erp24/services/MotivationService.php index aa10cae2..fcb72b15 100644 --- a/erp24/services/MotivationService.php +++ b/erp24/services/MotivationService.php @@ -765,13 +765,13 @@ class MotivationService $motivation = Motivation::find()->where(['store_id' => $store_id, 'year' => $year, 'month' => $month])->one(); if ($motivation) { $timetableFactModels = TimetableFactModel::find()->select(['DISTINCT(admin_id) as admin_id'])->where(['store_id' => $store_id]) - ->andWhere(['between', 'date_shift', $monthStart, $monthEnd])->all(); + ->andWhere(['between', 'date', $monthStart, $monthEnd])->all(); $adminIds = ArrayHelper::getColumn($timetableFactModels, 'admin_id'); $result = 0; foreach ($adminIds as $admin_id) { $timetableFactModel = TimetableFactModel::find()->select(['COUNT(*) as total', 'admin_group_id'])->where(['store_id' => $store_id, 'admin_id' => $admin_id]) - ->andWhere(['between', 'date_shift', $monthStart, $monthEnd])->groupBy(['admin_group_id'])->asArray()->one(); + ->andWhere(['between', 'date', $monthStart, $monthEnd])->groupBy(['admin_group_id'])->asArray()->one(); $norma = 15; if ($timetableFactModel['admin_group_id'] != AdminGroup::GROUP_WORKERS) { @@ -803,8 +803,8 @@ class MotivationService $records = TimetableFactModel::find() ->select(['DISTINCT ON (date_shift, admin_id) *']) ->where(['store_id' => $storeId]) - ->andWhere(['between', 'date_shift', $startDate, $endDate]) - ->orderBy(['date_shift' => SORT_ASC, 'admin_id' => SORT_ASC, 'id' => SORT_ASC]) + ->andWhere(['between', 'date', $startDate, $endDate]) + ->orderBy(['date' => SORT_ASC, 'admin_id' => SORT_ASC, 'id' => SORT_ASC]) ->all(); return $records; -- 2.39.5