title = Yii::t('common', 'Masters');
$this->params['breadcrumbs'][] = $this->title;
?>
beginBlock('content-header') ?>
= $this->title . ' ' . Html::a(Yii::t('common', 'Create Master'), ['create'], ['class' => 'btn btn-success']) ?>
endBlock() ?>
render('_search', ['model' => $searchModel]); ?>
= GridView::widget([
'dataProvider' => $dataProvider,
//'filterModel' => $searchModel,
'columns' => [
'id',
'name',
'desc',
[
'attribute' => 'province',
'format' => 'raw',
'value' => function ($model) {
return \common\models\Region::getNameById($model->province);
},
],
[
'attribute' => 'city',
'format' => 'raw',
'value' => function ($model) {
return \common\models\Region::getNameById($model->city);
},
],
[
'attribute' => 'area',
'format' => 'raw',
'value' => function ($model) {
return \common\models\Region::getNameById($model->area);
},
],
// 'address',
'fields',
'works',
'tel',
'created_at:datetime',
'updated_at:datetime',
[
'attribute' => 'status',
'value' => function ($model) {
return Master::getStatusList($model->status);
},
],
['class' => 'common\helpers\DiyActionColumn',
'template' => '{goods} {view} {update} {delete}',
'buttons' => [
'goods' => function ($url, $model, $key) {
return Html::a('商品设置', Url::to(['/goods-index/create', 'entity' => Master::className(),'entity_id'=>$model->id,'origin'=>Yii::$app->request->url]), [
'class' => 'btn btn-success btn-xs',
'title'=>Yii::t('common', 'Create Goods Index'),
'target'=>'_blank'
]);
},
'view' => function ($url, $model, $key) {
return Html::a('查看', Url::to(['/master/view', 'id' => $model->id]), [
'class' => 'btn btn-success btn-xs',
'title'=>$model->name.'详情',
'target'=>'_blank'
]);
},
]
],
],
]); ?>