From c54cb3e6270938cca80d6bfb7188f371e8c282ee Mon Sep 17 00:00:00 2001 From: fomichev Date: Thu, 15 May 2025 20:45:48 +0300 Subject: [PATCH] =?utf8?q?=D0=A0=D0=B0=D1=81=D1=87=D0=B5=D1=82=20=D1=86?= =?utf8?q?=D0=B5=D0=BB=D0=B8=20=D0=B1=D1=83=D0=BA=D0=B5=D1=82=D0=B0=20?= =?utf8?q?=D0=B2=D1=8B=D0=B1=D0=BE=D1=80=20=D0=BC=D0=B0=D0=B3=D0=B0=D0=B7?= =?utf8?q?=D0=B8=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/services/StorePlanService.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/erp24/services/StorePlanService.php b/erp24/services/StorePlanService.php index e14f6bd2..a5664825 100755 --- a/erp24/services/StorePlanService.php +++ b/erp24/services/StorePlanService.php @@ -928,17 +928,13 @@ class StorePlanService ); } // var_dump($stores); die(); - $storesParams = ArrayHelper::map( - CityStoreParams::find() - ->select(['store_id', 'address_region']) + $storesParams = CityStoreParams::find() + ->select(['store_id', 'address_region', 'store_type']) ->where(['store_id' => $stores]) ->andWhere(['not', ['address_region' => '']]) ->asArray() ->indexBy('store_id') - ->all(), - 'store_id', - 'address_region' - ); + ->all(); $forecasts = MatrixBouquetForecast::find() ->where(['year' => $year, 'month' => $month]) @@ -981,13 +977,23 @@ class StorePlanService 'internet' => 'online' ]; + $storeSizeTypes = [ + 1 => 's_store', + 2 => 'm_store', + 3 => 'l_store', + 4 => 'xl_store', + + ]; + foreach ($types as $field => $typeSales) { + $typeSalesValue = (int)$forecast[$field]; if ($typeSalesValue <= 0) { continue; } - foreach ($storesParams as $storeId => $regionId) { + foreach ($storesParams as $storeId => $params) { + $regionId = $params['region_id']; if (!$regionId) { if (CityStore::find()->where(['id' => $storeId])->one()->city_id == 1342) { $regionId = 52; -- 2.39.5