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.
 
 
 

64 lines
1.8 KiB

<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use antgoods\models\ars\ShopCategory;
use antgoods\models\ars\Attribute;
/* @var $this yii\web\View */
/* @var $model antgoods\models\ars\ShopCategory */
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => '前端商品分类', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
\yii\web\YiiAsset::register($this);
$filter_attr_arr = explode(',', $model->filter_attr);
$attr_str = '';
foreach ($filter_attr_arr as $filter_attr_id) {
$attr = Attribute::findOne($filter_attr_id);
if ($attr) {
$attr_str = $attr_str . ',' . $attr->name;
}
}
$attr_str = substr($attr_str, 1);
?>
<div class="shop-category-view">
<p>
<?= Html::a('返回列表', ['index'], ['class' => 'btn btn-success']) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'name',
'keywords',
'desc',
'sort_order',
['attribute' => 'icon',
'width'=>'10%',
'format' => 'raw',
'value' => function ($model) {
return $model->iconFile ?
\yii\bootstrap4\Html::img(['/'.$model->iconFile->path], ['style' => 'width:80px'])
: '未设置';
}
],
['attribute' => 'filter_attr',
'value' => $attr_str
],
['attribute' => 'is_show',
'width' => '5%',
'value' =>
function ($model) {
return $model->is_show == ShopCategory::IS_SHOW_HIDE ? '隐藏' : '显示';
},
],
'created_at:datetime',
'updated_at:datetime',
],
]) ?>
</div>