From: fomichev Date: Fri, 6 Jun 2025 09:08:05 +0000 (+0300) Subject: Исправление по ревью X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=01f84afd5d9160794de6aff0bb7f39ff8ae59b78;p=erp24_rep%2Fyii-erp24%2F.git Исправление по ревью --- diff --git a/erp24/controllers/AutoPlannogrammaController.php b/erp24/controllers/AutoPlannogrammaController.php index ad9bbc52..81240cb3 100644 --- a/erp24/controllers/AutoPlannogrammaController.php +++ b/erp24/controllers/AutoPlannogrammaController.php @@ -360,8 +360,8 @@ class AutoPlannogrammaController extends BaseController $allProdIds = []; $categoryRows = []; + $storeNames = CityStore::find()->select(['id', 'name'])->indexBy('id')->asArray()->all(); foreach ($data as $storeId => $categories) { - $storeName = CityStore::findOne($storeId)->name ?? null; foreach ($categories as $row) { $prodIds = array_filter(explode(',', $row['products_list'] ?? ''), fn($v)=>$v!==''); $prodCompIds = array_filter(explode(',', $row['products_components_list'] ?? ''), fn($v)=>$v!==''); @@ -369,7 +369,7 @@ class AutoPlannogrammaController extends BaseController $categoryRows[] = [ 'store_id' => (string)$storeId, - 'store_name' => $storeName, + 'store_name' => $storeNames[$storeId]['name'], 'category' => $row['category'], 'base_total_store' => $row['base_total_store'], 'new_total_store' => $row['new_total_store'],