]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Замена на константы
authorVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 10 Dec 2025 08:13:47 +0000 (11:13 +0300)
committerVladimir Fomichev <vladimir.fomichev@erp-flowers.ru>
Wed, 10 Dec 2025 08:13:47 +0000 (11:13 +0300)
erp24/api3/core/services/ReportService.php
erp24/records/Shift.php

index af90d302176430fd392908406bd336eed32f2867..2666e97d1cc8feff7e6f28c5c1a679f6768c1533 100644 (file)
@@ -486,7 +486,7 @@ class ReportService
                     ],
                 ]);
             }
-            if ($data->shift_type == 0) {
+            if ($data->shift_type == Shift::FULL_DAY_SHIFT) {
                 $storeVisitorsQuery->andWhere([
                     'or',
                     [
@@ -1119,7 +1119,7 @@ class ReportService
                         ],
                     ]);
                 }
-                if ($data->shift_type == 0) {
+                if ($data->shift_type == Shift::FULL_DAY_SHIFT) {
                     $storeVisitorsQuery->andWhere([
                         'or',
                         [
@@ -1482,7 +1482,7 @@ class ReportService
             ->andWhere(['shift_id' => $shiftIds]);
 
         // Для типа смены 0 (обе смены) считаем каждую смену отдельно
-        if ($data->shift_type == 0) {
+        if ($data->shift_type == Shift::FULL_DAY_SHIFT) {
             // Для обеих смен нужны уникальные комбинации admin_id и shift_id
             $allAdminsInPeriod = $allAdminsInPeriodQuery
                 ->select(['admin_id', 'shift_id'])
@@ -1641,7 +1641,7 @@ class ReportService
                     ],
                 ]);
             }
-            if ($data->shift_type == 0) {
+            if ($data->shift_type == Shift::FULL_DAY_SHIFT) {
                 $storeVisitorsQuery->andWhere([
                     'or',
                     [
index 991991a50cdcf7021168c0e2c001e72bffbd507d..5d14c2fa2d80fe0143c86a74b390b053519378a3 100755 (executable)
@@ -21,6 +21,7 @@ class Shift extends ActiveRecord
 {
     const DAY = 1;
     const NIGHT = 2;
+    const FULL_DAY_SHIFT = 0;
     const ADMINISTRATOR_8_17 = 5;
     const ADMINISTRATOR_9_18 = 8;