From: Alexander Smirnov Date: Mon, 9 Sep 2024 18:12:29 +0000 (+0300) Subject: [ERP-152] Правки по комментариям X-Git-Tag: 1.5~30^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=refs%2Fremotes%2Forigin%2Ffeature_smirnov_erp-152_storage;p=erp24_rep%2Fyii-erp24%2F.git [ERP-152] Правки по комментариям --- diff --git a/erp24/actions/storage/IndexAction.php b/erp24/actions/storage/IndexAction.php index 27678bb5..716dcabd 100644 --- a/erp24/actions/storage/IndexAction.php +++ b/erp24/actions/storage/IndexAction.php @@ -21,9 +21,9 @@ class IndexAction extends Action $products1c = Products1c::find()->where(['id' => $model->store_id])->one(); } - $stores = ArrayHelper::map(Products1c::find()->where(['tip' => 'city_store', 'view' => 1])->orderBy(['name' => SORT_ASC])->all(),"id", "name"); + $stores = ArrayHelper::map(Products1c::find()->select(['id', 'name'])->where(['tip' => 'city_store', 'view' => 1])->orderBy(['name' => SORT_ASC])->all(),"id", "name"); - $products = ArrayHelper::map(Products1c::find()->where(['tip' => 'products'])->all(),"id", "name"); + $products = ArrayHelper::map(Products1c::find()->select(['id', 'name'])->where(['tip' => 'products'])->all(),"id", "name"); $balances = Balances::find()->select(['product_id', 'quantity', 'reserv'])->where(['store_id' => $model->store_id])->orderBy(['quantity' => SORT_DESC])->all(); diff --git a/erp24/actions/storage/StoreAction.php b/erp24/actions/storage/StoreAction.php index 79cdf3e1..be913d86 100644 --- a/erp24/actions/storage/StoreAction.php +++ b/erp24/actions/storage/StoreAction.php @@ -21,16 +21,14 @@ class StoreAction extends Action $products1c = Products1c::find()->where(['id' => $model->store_id])->one(); } - $stores = ArrayHelper::map(Products1c::find()->where(['tip' => 'city_store', 'view' => 1])->orderBy(['name' => SORT_ASC])->all(),"id", "name"); + $stores = ArrayHelper::map(Products1c::find()->select(['id', 'name'])->where(['tip' => 'city_store', 'view' => 1])->orderBy(['name' => SORT_ASC])->all(),"id", "name"); $productGroups = Products1c::find()->where(['tip' => 'products_group', 'view' => 1])->orderBy(['name' => SORT_ASC])->all(); - $groups = ArrayHelper::map($productGroups, 'id', 'name'); $groups_arr = []; foreach ($productGroups as $productGroup) { $groups_arr[$productGroup->parent_id][$productGroup->id] = $productGroup; } - return $this->controller->render('store', compact('model', 'stores', 'products1c', 'groups_arr')); }