GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], 'id', [ 'attribute' => 'parent_id', 'label'=>'父级', 'value'=>function($model){ return ArrayHelper::getValue(Inter::findOne($model->parent_id),'name');}, ], 'name', [ 'attribute' => 'type_id', 'label'=>'接口类型', 'value'=>function($model){ return ArrayHelper::getValue(Inter_type::findOne($model->type_id),'name');}, ], 'url', [ 'attribute' => 'log', 'label'=>'记录日志', 'value'=>function($model){ return Inter::status($model->log);}, ], [ 'attribute' => 'cache', 'label'=>'使用缓存', 'value'=>function($model){ return Inter::status($model->cache);}, ], [ 'attribute' => 'cache_time', 'label'=>'缓存时间', 'value'=>function($model){ return $model->cache_time.'秒';}, ], [ 'attribute' => 'status', 'label'=>'是否可用', 'value'=>function($model){ return Inter::status($model->status);}, ], ['class' => 'yii\grid\ActionColumn'], ], ]);