You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.7 KiB

  1. <?php
  2. use backend\modules\shop\models\ars\Area;
  3. use backend\modules\shop\models\ars\City;
  4. use backend\modules\shop\models\ars\Province;
  5. use yii\helpers\Html;
  6. use yii\widgets\DetailView;
  7. /* @var $this yii\web\View */
  8. /* @var $model backend\models\ars\TakingSite */
  9. $this->title = $model->name;
  10. $this->params['breadcrumbs'][] = ['label' => 'Taking Sites', 'url' => ['index']];
  11. $this->params['breadcrumbs'][] = $this->title;
  12. \yii\web\YiiAsset::register($this);
  13. ?>
  14. <div class="taking-site-view">
  15. <p>
  16. <?= Html::a('返回列表', ['index'], ['class' => 'btn btn-success']) ?>
  17. </p>
  18. <?= DetailView::widget([
  19. 'model' => $model,
  20. 'attributes' => [
  21. 'id',
  22. 'name',
  23. [
  24. 'attribute' => 'province',
  25. 'value' => function ($model) {
  26. $province = Province::findOne(['province_id' => $model->province]);
  27. if ($province) {
  28. return $province->name;
  29. }
  30. }
  31. ],
  32. [
  33. 'attribute' => 'city',
  34. 'value' => function ($model) {
  35. $city = City::findOne(['city_id' => $model->city]);
  36. if ($city) {
  37. return $city->name;
  38. }
  39. }
  40. ],
  41. [
  42. 'attribute' => 'area',
  43. 'value' => function ($model) {
  44. $area = Area::findOne(['area_id' => $model->area]);
  45. if ($area) {
  46. return $area->name;
  47. }
  48. }
  49. ],
  50. 'address:ntext',
  51. 'updated_at:datetime',
  52. 'created_at:datetime',
  53. ],
  54. ]) ?>
  55. </div>