Browse Source

后台商品分类增加父类

antshop
linyaostalker 5 years ago
parent
commit
d5210ed1b2
  1. 11
      backend/modules/goods/models/searchs/CategorySearch.php

11
backend/modules/goods/models/searchs/CategorySearch.php

@ -55,6 +55,17 @@ class CategorySearch extends Category
], ],
'id', 'id',
'name', 'name',
[
'attribute' => 'pid',
'value' => function ($model) {
$parentsCategory = Category::findOne($model->pid);
if ($parentsCategory) {
return $parentsCategory->name;
} else {
return '一级分类';
}
}
],
['attribute' => 'icon', ['attribute' => 'icon',
'contentOptions' => [ 'contentOptions' => [
'align' => 'center', 'align' => 'center',

Loading…
Cancel
Save