From: Vladimir Fomichev Date: Wed, 10 Dec 2025 08:13:47 +0000 (+0300) Subject: Замена на константы X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=083f66d183925bbbf4fa1e37ddaf234582149efe;p=erp24_rep%2Fyii-erp24%2F.git Замена на константы --- diff --git a/erp24/api3/core/services/ReportService.php b/erp24/api3/core/services/ReportService.php index af90d302..2666e97d 100644 --- a/erp24/api3/core/services/ReportService.php +++ b/erp24/api3/core/services/ReportService.php @@ -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', [ diff --git a/erp24/records/Shift.php b/erp24/records/Shift.php index 991991a5..5d14c2fa 100755 --- a/erp24/records/Shift.php +++ b/erp24/records/Shift.php @@ -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;