]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Убрал дистинкты
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 10 Dec 2025 07:14:00 +0000 (10:14 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 10 Dec 2025 07:14:00 +0000 (10:14 +0300)
erp24/api3/core/services/ReportService.php

index 2d9d77dd7dedf033a319c5aceb85459fc937b223..750100ba963f37ea595767d5026d09659b2208f8 100644 (file)
@@ -977,7 +977,6 @@ class ReportService
 
         $allAdminsInPeriod = TimetableFactModel::find()
             ->select(['admin_id'])
-            //->distinct()
             ->where(['store_id' => $data->stores])
             ->andWhere($cond)
             ->andWhere(['>', 'work_time', 0])
@@ -1002,7 +1001,6 @@ class ReportService
             foreach ($data->stores as $store_id) {
                 $employees = TimetableFactModel::find()
                     ->select(['admin_id', 'shift_id'])
-                    //->distinct()
                     ->where(['store_id' => $store_id])
                     ->andWhere(['>=', 'date', date("Y-m-d", strtotime($dateStartEnd[0]))])
                     ->andWhere(['<=', 'date', date("Y-m-d", strtotime($dateStartEnd[1]))])
@@ -1489,7 +1487,6 @@ class ReportService
             // Для обеих смен нужны уникальные комбинации admin_id и shift_id
             $allAdminsInPeriod = $allAdminsInPeriodQuery
                 ->select(['admin_id', 'shift_id'])
-                //->distinct()
                 ->asArray()
                 ->all();
             $employeeCountTotal = count($allAdminsInPeriod);
@@ -1499,7 +1496,6 @@ class ReportService
         } else {
             $allAdminsInPeriod = $allAdminsInPeriodQuery
                 ->select(['admin_id'])
-                //->distinct()
                 ->asArray()
                 ->all();
             $adminIdsInPeriod = ArrayHelper::getColumn($allAdminsInPeriod, 'admin_id');