]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
[ERP-152] Правки по комментариям origin/feature_smirnov_erp-152_storage
authorAlexander Smirnov <fredeom@mail.ru>
Mon, 9 Sep 2024 18:12:29 +0000 (21:12 +0300)
committerAlexander Smirnov <fredeom@mail.ru>
Mon, 9 Sep 2024 18:12:29 +0000 (21:12 +0300)
erp24/actions/storage/IndexAction.php
erp24/actions/storage/StoreAction.php

index 27678bb5328a2ff1aefe4bcaad68b023a7f9830e..716dcabd9126e579d0c44999f4a0daace57d15a0 100644 (file)
@@ -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();
 
index 79cdf3e1c794895d50ec1a8a9a650147317fd066..be913d860e6c4a7e22651309b3b5c038658efe9e 100644 (file)
@@ -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'));
     }