Browse Source

修改自提视图列表字段显示

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
bf44c470ed
  1. 37
      backend/modules/shop/views/taking-site/view.php

37
backend/modules/shop/views/taking-site/view.php

@ -1,5 +1,8 @@
<?php
use backend\modules\shop\models\ars\Area;
use backend\modules\shop\models\ars\City;
use backend\modules\shop\models\ars\Province;
use yii\helpers\Html;
use yii\widgets\DetailView;
@ -22,12 +25,36 @@ $this->params['breadcrumbs'][] = $this->title;
'attributes' => [
'id',
'name',
'province',
'city',
'area',
[
'attribute' => 'province',
'value' => function ($model) {
$province = Province::findOne(['province_id' => $model->province]);
if ($province) {
return $province->name;
}
}
],
[
'attribute' => 'city',
'value' => function ($model) {
$city = City::findOne(['city_id' => $model->city]);
if ($city) {
return $city->name;
}
}
],
[
'attribute' => 'area',
'value' => function ($model) {
$area = Area::findOne(['area_id' => $model->area]);
if ($area) {
return $area->name;
}
}
],
'address:ntext',
'updated_at',
'created_at',
'updated_at:datetime',
'created_at:datetime',
],
]) ?>

Loading…
Cancel
Save