From eedc847a2a2a972554ac6fd479c3f24babf63646 Mon Sep 17 00:00:00 2001 From: marina Date: Mon, 16 Jun 2025 15:37:00 +0300 Subject: [PATCH] =?utf8?q?ERP-360=20=D0=A1=D0=B1=D0=BE=D1=80=D0=BA=D0=B0?= =?utf8?q?=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20=D0=B0?= =?utf8?q?=D0=B2=D1=82=D0=BE=D0=BF=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../AutoPlannogrammaController.php | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index a3a78609..d124e048 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -926,7 +926,6 @@ class AutoPlannogrammaController extends BaseController ); - /* $matrixForecast = MatrixBouquetForecast::find() ->where(['year' => $filters['year'], 'month' => $filters['month']]) ->asArray() @@ -1757,9 +1756,9 @@ class AutoPlannogrammaController extends BaseController $request = Yii::$app->request; $storeIdRequest = $request->get('storeId'); - $monthRequest = $request->get('month'); - $yearRequest = $request->get('year'); - $weekRequest = $request->get('week'); + $monthRequest = $request->get('month'); + $yearRequest = $request->get('year'); + $weekRequest = $request->get('week'); if (!$monthRequest || !$yearRequest || $weekRequest === null) { return ['success' => false, 'message' => 'Нет параметров']; @@ -1775,19 +1774,19 @@ class AutoPlannogrammaController extends BaseController $grouped = []; foreach ($result as $item) { - $weekItem = (int) $item['week']; - $storeItem = (int) $item['store_id']; - $guid = (string) $item['product_guid']; - $group = (string) $item['matrix_group']; - $type = (string) $item['type']; - $forecastValue = (float) $item['week_forecast']; + $weekItem = (int)$item['week']; + $storeItem = (int)$item['store_id']; + $guid = (string)$item['product_guid']; + $group = (string)$item['matrix_group']; + $type = (string)$item['type']; + $forecastValue = (float)$item['week_forecast']; $grouped[$weekItem][$storeItem][$guid][$type][$group] = $forecastValue; } if ($weekRequest !== null) { - $week = (int) $weekRequest; + $week = (int)$weekRequest; $grouped = isset($grouped[$week]) ? [$week => $grouped[$week]] : []; } @@ -1799,7 +1798,6 @@ class AutoPlannogrammaController extends BaseController } - public function actionGetSubcategories(string $category, int $year, int $week): array { Yii::$app->response->format = Response::FORMAT_JSON; @@ -1820,5 +1818,4 @@ class AutoPlannogrammaController extends BaseController return $data; } - } -- 2.39.5