From 071a5fbd846aed003af54613fea86413a9e1445f Mon Sep 17 00:00:00 2001 From: Kavalar Date: Sun, 26 May 2024 13:05:24 +0300 Subject: [PATCH] fix --- frontend/modules/product/views/product/index.php | 2 +- .../controllers/ProductCategoryController.php | 1 + .../views/product-category/index.php | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/frontend/modules/product/views/product/index.php b/frontend/modules/product/views/product/index.php index c061d8e..706eb7f 100644 --- a/frontend/modules/product/views/product/index.php +++ b/frontend/modules/product/views/product/index.php @@ -35,7 +35,7 @@ $this->params['breadcrumbs'][] = $this->title; 'article', //'company_id', //'type', - //'price', + 'price', //'status', ['class' => 'hail812\adminlte3\yii\grid\ActionColumn'], diff --git a/frontend/modules/product_category/controllers/ProductCategoryController.php b/frontend/modules/product_category/controllers/ProductCategoryController.php index 61d2a4f..0ee7bf5 100644 --- a/frontend/modules/product_category/controllers/ProductCategoryController.php +++ b/frontend/modules/product_category/controllers/ProductCategoryController.php @@ -65,6 +65,7 @@ class ProductCategoryController extends Controller return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, + 'companyService' => $this->companyService, ]); } diff --git a/frontend/modules/product_category/views/product-category/index.php b/frontend/modules/product_category/views/product-category/index.php index 5b40cc2..b93fc6c 100644 --- a/frontend/modules/product_category/views/product-category/index.php +++ b/frontend/modules/product_category/views/product-category/index.php @@ -1,11 +1,13 @@ title = 'Категории товаров'; $this->params['breadcrumbs'][] = $this->title; @@ -33,8 +35,18 @@ $this->params['breadcrumbs'][] = $this->title; 'id', 'title', //'parent_id', - 'company_id', - 'status', + [ + 'attribute' => 'company_id', + 'value' => function($model) use ($companyService){ + return $companyService->getCompany($model->company_id)->name ?? null; + } + ], + [ + 'attribute' => 'status', + 'value' => function($model){ + return \common\models\ProductCategory::getStatus()[$model->status]; + } + ], ['class' => 'hail812\adminlte3\yii\grid\ActionColumn'], ],