|
|
@ -6,6 +6,7 @@ use yii\base\Model; |
|
|
|
use yii\data\ActiveDataProvider; |
|
|
|
use yii\helpers\ArrayHelper; |
|
|
|
use antgoods\goods\models\ars\Category; |
|
|
|
use yii\bootstrap4\Html; |
|
|
|
|
|
|
|
/** |
|
|
|
* CategorySearch represents the model behind the search form of `antgoods\goods\models\ars\Category`. |
|
|
@ -54,9 +55,36 @@ class CategorySearch extends Category |
|
|
|
], |
|
|
|
'id', |
|
|
|
'name', |
|
|
|
['attribute' => 'icon', |
|
|
|
'contentOptions' => [ |
|
|
|
'align' => 'center', |
|
|
|
], |
|
|
|
'width'=>'10%', |
|
|
|
'format' => 'raw', |
|
|
|
'value' => function ($model) { |
|
|
|
return $model->iconFile ? |
|
|
|
Html::img(['/'.$model->iconFile->path], ['style' => 'width:80px']) |
|
|
|
: '<div class="table_not_setting">未设置</div>'; |
|
|
|
|
|
|
|
} |
|
|
|
], |
|
|
|
'sort_order', |
|
|
|
[ |
|
|
|
'class' => 'iron\grid\ActionColumn', |
|
|
|
'align' => 'center', |
|
|
|
'config' => [ |
|
|
|
[ |
|
|
|
'name' => 'update', |
|
|
|
'icon' => 'pencil', |
|
|
|
'title' => '修改' |
|
|
|
], |
|
|
|
[ |
|
|
|
'name' => 'delete', |
|
|
|
'icon' => 'trash', |
|
|
|
'title' => '删除', |
|
|
|
'contents' => '确定删除?' |
|
|
|
] |
|
|
|
], |
|
|
|
], |
|
|
|
]; |
|
|
|
} |
|
|
|