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