= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
[
'attribute' => 'cover',
'format' => 'raw',
'value' => function ($model) {
$images = [ // images at popup window of prettyPhoto galary
1 => [
'src' => $model->cover,
'title' => '',
],
];
return $model->cover ? LightBoxWidget::widget([
'id' => 'cover', // id of plugin should be unique at page
'class' => 'galary', // class of plugin to define style
'height' => '100px', // height of image visible in widget
'width' => '100px', // width of image visible in widget
'images' => $images,
]) : null;
}
],
[
'attribute' => 'banner',
'format' => 'raw',
'value' => function ($model) {
$images = [];
foreach ($model->banner as $index => $banner) {
$images[$index] = ['src' => $banner, 'title' => ''];
}
return $model->banner ? LightBoxWidget::widget([
'id' => 'banner', // id of plugin should be unique at page
'class' => 'galary', // class of plugin to define style
'height' => '100px', // height of image visible in widget
'width' => '100px', // width of image visible in widget
'images' => $images,
]) : null;
}
],
[
'attribute' => 'picture',
'format' => 'raw',
'value' => function ($model) {
$images = [];
foreach ($model->picture as $index => $picture) {
$images[$index] = ['src' => $picture, 'title' => ''];
}
return $model->picture ? LightBoxWidget::widget([
'id' => 'picture', // id of plugin should be unique at page
'class' => 'galary', // class of plugin to define style
'height' => '100px', // height of image visible in widget
'width' => '100px', // width of image visible in widget
'images' => $images,
]) : null;
}
],
[
'attribute' => 'vid',
'format' => 'raw',
'value' => function ($model){
return '';
}
],
[
'attribute' => 'compere_id',
'format' => 'raw',
'value' => function ($model) {
if (!empty($model->compere)) {
return Html::a($model->compere->name, \yii\helpers\Url::to(['/compere/view', 'id' => $model->compere_id]), ['title' => '详情', 'target' => '_blank']);
} else {
return '无';
}
},
],
[
'attribute' => 'master_id',
'format' => 'raw',
'value' => function ($model) {
if (!empty($model->master)) {
return Html::a($model->master->name, \yii\helpers\Url::to(['/master/view', 'id' => $model->master_id]), ['title' => '详情', 'target' => '_blank']);
} else {
return '无';
}
},
],
'title',
'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',
'created_at:datetime',
'updated_at:datetime',
[
'attribute' => 'status',
'value' => function ($model) {
return Interview::getStatusList($model->status);
},
],
],
]) ?>
= GridView::widget([
'dataProvider' => $log['data'],
'columns' => [
'id',
'interview_id',
'type',
'content',
'created_at',
'updated_at',
'status',
[
'class' => 'common\helpers\DiyActionColumn',
'template' => '{update} {delete}',
'buttons' => [
'update' => function ($url, $model, $key) {
return Html::a(Yii::t('yii', 'Update'), Url::to(['/interview-log/update', 'id' => $model->id, 'origin' => Yii::$app->request->url]), [
'class' => 'btn btn-success btn-xs',
'title' => Yii::t('common', 'Update Interview Log'),
'target' => '_blank'
]);
},
'delete' => function ($url, $model, $key) {
return Html::a('删除', Url::to(['/interview-log/delete', 'id' => $model->id, 'origin' => Yii::$app->request->url]), [
'class' => 'btn btn-success btn-xs',
'title' => Yii::t('common', '删除访谈记录'),
'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'),
'data-method' => 'post',
]);
},
],
],
],
]); ?>
= GridView::widget([
'dataProvider' => $index['data'],
//'filterModel' => $searchModel,
'columns' => [
'id',
'goods_id',
'entity',
'entity_id',
'attribute',
[
'class' => 'common\helpers\DiyActionColumn',
'template' => '{update} {delete}',
'buttons' => [
'update' => function ($url, $model, $key) {
return Html::a(Yii::t('yii', 'Update'), Url::to(['/goods-index/update', 'id' => $model->id, 'origin' => Yii::$app->request->url]), [
'class' => 'btn btn-success btn-xs',
'title' => Yii::t('common', 'Update Goods Index'),
'target' => '_blank'
]);
},
'delete' => function ($url, $model, $key) {
return Html::a('删除', Url::to(['/goods-index/delete', 'id' => $model->id, 'origin' => Yii::$app->request->url]), [
'class' => 'btn btn-success btn-xs',
'title' => Yii::t('common', '删除关联商品'),
'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'),
'data-method' => 'post',
]);
},
],
],
],
]); ?>