From 67135e03ebf01fa85647385d44e070ac3ac86098 Mon Sep 17 00:00:00 2001 From: Vladimir Fomichev Date: Wed, 10 Dec 2025 11:08:24 +0300 Subject: [PATCH] =?utf8?q?=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20=D0=BD?= =?utf8?q?=D0=B0=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/api3/core/services/ReportService.php | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/erp24/api3/core/services/ReportService.php b/erp24/api3/core/services/ReportService.php index 94e16d89..af90d302 100644 --- a/erp24/api3/core/services/ReportService.php +++ b/erp24/api3/core/services/ReportService.php @@ -448,14 +448,14 @@ class ReportService ->indexBy('store_id') ->asArray()->all(); - $date_start = $data->shift_type == 2 ? + $date_start = $data->shift_type == Shift::NIGHT ? date("Y-m-d 20:00:00", strtotime($currentDate)) : - ($data->shift_type == 1 ? + ($data->shift_type == Shift::DAY ? date("Y-m-d 08:00:00", strtotime($currentDate)) : date("Y-m-d 00:00:00", strtotime($currentDate))); - $date_end = $data->shift_type == 1 ? + $date_end = $data->shift_type == Shift::DAY ? date("Y-m-d 20:00:00", strtotime($currentDate)) : - ($data->shift_type == 2 ? + ($data->shift_type == Shift::NIGHT ? date("Y-m-d 08:00:00", strtotime("+1 day", strtotime($currentDate))) : date("Y-m-d 00:00:00", strtotime("+1 day", strtotime($currentDate)))); @@ -465,11 +465,11 @@ class ReportService 'store_id', ]); - if ($data->shift_type == 1) { + if ($data->shift_type == Shift::DAY) { $storeVisitorsQuery->andWhere(['>=', 'date_hour', 8])->andWhere(['<=', 'date_hour', 20]) ->andWhere(['date' => date("Y-m-d", strtotime($currentDate))]); } - if ($data->shift_type == 2) { + if ($data->shift_type == Shift::NIGHT) { $storeVisitorsQuery->andWhere([ 'or', [ @@ -1080,14 +1080,14 @@ class ReportService ->indexBy('store_id') ->asArray()->all(); - $date_start = $data->shift_type == 2 ? + $date_start = $data->shift_type == Shift::NIGHT ? date("Y-m-d 20:00:00", strtotime($currentDate)) : - ($data->shift_type == 1 ? + ($data->shift_type == Shift::DAY ? date("Y-m-d 08:00:00", strtotime($currentDate)) : date("Y-m-d 00:00:00", strtotime($currentDate))); - $date_end = $data->shift_type == 1 ? + $date_end = $data->shift_type == Shift::DAY ? date("Y-m-d 20:00:00", strtotime($currentDate)) : - ($data->shift_type == 2 ? + ($data->shift_type == Shift::NIGHT ? date("Y-m-d 08:00:00", strtotime("+1 day", strtotime($currentDate))) : date("Y-m-d 00:00:00", strtotime("+1 day", strtotime($currentDate)))); @@ -1098,11 +1098,11 @@ class ReportService 'store_id' ]); - if ($data->shift_type == 1) { + if ($data->shift_type == Shift::DAY) { $storeVisitorsQuery->andWhere(['>=', 'date_hour', 8])->andWhere(['<=', 'date_hour', 20]) ->andWhere(['date' => date("Y-m-d", strtotime($currentDate))]); } - if ($data->shift_type == 2) { + if ($data->shift_type == Shift::NIGHT) { $storeVisitorsQuery->andWhere([ 'or', [ @@ -1599,11 +1599,11 @@ class ReportService ->indexBy('store_id') ->asArray()->all(); - if ($data->shift_type == 2) { + if ($data->shift_type == Shift::NIGHT) { // Ночная смена $date_start = date("Y-m-d 20:00:00", strtotime($day)); $date_end = date("Y-m-d 08:00:00", strtotime("+1 day", strtotime($day))); - } elseif ($data->shift_type == 1) { + } elseif ($data->shift_type == Shift::DAY) { // Дневная смена $date_start = date("Y-m-d 08:00:00", strtotime($day)); $date_end = date("Y-m-d 20:00:00", strtotime($day)); @@ -1620,11 +1620,11 @@ class ReportService 'store_id' ]); - if ($data->shift_type == 1) { + if ($data->shift_type == Shift::DAY) { $storeVisitorsQuery->andWhere(['>=', 'date_hour', 8])->andWhere(['<=', 'date_hour', 20]) ->andWhere(['date' => date("Y-m-d", strtotime($day))]); } - if ($data->shift_type == 2) { + if ($data->shift_type == Shift::NIGHT) { $storeVisitorsQuery->andWhere([ 'or', [ -- 2.39.5