From c20ed1a570eaf493be6df408a41be6d8ee87d011 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Mon, 17 Nov 2025 17:00:53 +0300 Subject: [PATCH] =?utf8?q?=D0=A3=D0=B1=D0=B8=D1=80=D0=B0=D0=B5=D0=BC=20?= =?utf8?q?=D0=B4=D1=83=D0=B1=D0=BB=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?utf8?q?=D0=B8=D0=B5=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F=D0=B5?= =?utf8?q?=D0=BC=20=D1=84=D0=B8=D0=BB=D1=8C=D1=82=D1=80=20=D0=BF=D0=BE=20?= =?utf8?q?=D0=B0=D0=BA=D1=82=D0=B8=D0=B2=D0=BD=D0=BE=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/api3/core/services/ReportService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erp24/api3/core/services/ReportService.php b/erp24/api3/core/services/ReportService.php index a0d36648..dea5f2da 100644 --- a/erp24/api3/core/services/ReportService.php +++ b/erp24/api3/core/services/ReportService.php @@ -334,12 +334,12 @@ class ReportService // Получаем все уникальные admin_id сотрудников за период $allAdminsInPeriod = Timetable::find()->alias('t') ->select(['admin_id']) + ->distinct() ->where(['t.store_id' => $data->stores]) ->andWhere(['>=', 'date', date("Y-m-01", strtotime($data->date_start))]) ->andWhere(['<=', 'date', $data->date_end]) ->andWhere(['tabel' => 0, 'slot_type_id' => Timetable::TIMESLOT_WORK]) - ->andWhere(['IS', 't.deleted_at', null]) - ->groupBy(['admin_id']) + ->andWhere(['active' => 1]) ->asArray()->all(); $adminIdsInPeriod = ArrayHelper::getColumn($allAdminsInPeriod, 'admin_id'); @@ -359,7 +359,7 @@ class ReportService ->andWhere(['>=', 'date', date("Y-m-01", strtotime($currentDate))]) ->andWhere(['<=', 'date', $currentDate]) ->andWhere(['shift_id' => $shift_id, 'tabel' => 0, 'slot_type_id' => Timetable::TIMESLOT_WORK]) - ->andWhere(['IS', 't.deleted_at', null]) + ->andWhere(['active' => 1]) ->asArray()->all(); $timetables = Timetable::find()->alias('t')->select(['admin_id', 'a.name as adminName', 't.store_id', 't.shift_id']) @@ -367,7 +367,7 @@ class ReportService ->where(['t.store_id' => $data->stores]) ->andWhere(['date' => $currentDate, 'tabel' => 0]) ->andWhere(['shift_id' => $shift_id, 'slot_type_id' => Timetable::TIMESLOT_WORK]) - ->andWhere(['IS', 't.deleted_at', null]) + ->andWhere(['active' => 1]) ->asArray()->all(); $adminIdsMonth = ArrayHelper::getColumn($timetablesMonth, 'admin_id'); -- 2.39.5