linyaostalker
5 years ago
2 changed files with 75 additions and 0 deletions
-
24backend/modules/shop/controllers/ExpressTemplateController.php
-
51backend/modules/shop/views/express-template/express_area_view.php
@ -0,0 +1,51 @@ |
|||
<?php |
|||
|
|||
use yii\helpers\Html; |
|||
use yii\widgets\DetailView; |
|||
use backend\modules\shop\models\ars\ExpressTemplate; |
|||
|
|||
/* @var $this yii\web\View */ |
|||
/* @var $model backend\modules\shop\models\ars\ExpressTemplate */ |
|||
|
|||
$this->title = $model->name; |
|||
$this->params['breadcrumbs'][] = ['label' => 'Express Templates', 'url' => ['index']]; |
|||
$this->params['breadcrumbs'][] = $this->title; |
|||
\yii\web\YiiAsset::register($this); |
|||
?>
|
|||
<div class="express-template-view"> |
|||
|
|||
<p> |
|||
<?= Html::a('返回列表', ['index'], ['class' => 'btn btn-success']) ?>
|
|||
</p> |
|||
|
|||
<?= DetailView::widget([ |
|||
'model' => $model, |
|||
'attributes' => [ |
|||
'id', |
|||
'name', |
|||
[ |
|||
'attribute' => 'calculation_type', |
|||
'value' => function ($model) { |
|||
return ExpressTemplate::$calculationType[$model->calculation_type]; |
|||
} |
|||
], |
|||
'basic_price', |
|||
'basic_count', |
|||
'extra_price', |
|||
'extra_count', |
|||
'updated_at:datetime', |
|||
'created_at:datetime', |
|||
['attribute' => 'city', |
|||
'value' => function ($model) { |
|||
$array = explode(',', $model->city); |
|||
$cities = []; |
|||
foreach (\backend\modules\shop\models\ars\City::find()->andWhere(['in', 'city_id', $array])->all() as $city) { |
|||
$cities[] = $city->name; |
|||
} |
|||
return implode(' // ', $cities); |
|||
}, |
|||
], |
|||
], |
|||
]) ?>
|
|||
|
|||
</div> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue