|
@ -3,6 +3,7 @@ |
|
|
use yii\helpers\Html; |
|
|
use yii\helpers\Html; |
|
|
use yii\widgets\DetailView; |
|
|
use yii\widgets\DetailView; |
|
|
use antgoods\goods\models\ars\ShopCategory; |
|
|
use antgoods\goods\models\ars\ShopCategory; |
|
|
|
|
|
use antgoods\goods\models\ars\Attribute; |
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */ |
|
|
/* @var $this yii\web\View */ |
|
|
/* @var $model antgoods\goods\models\ars\ShopCategory */ |
|
|
/* @var $model antgoods\goods\models\ars\ShopCategory */ |
|
@ -11,6 +12,15 @@ $this->title = $model->name; |
|
|
$this->params['breadcrumbs'][] = ['label' => '前端商品分类', 'url' => ['index']]; |
|
|
$this->params['breadcrumbs'][] = ['label' => '前端商品分类', 'url' => ['index']]; |
|
|
$this->params['breadcrumbs'][] = $this->title; |
|
|
$this->params['breadcrumbs'][] = $this->title; |
|
|
\yii\web\YiiAsset::register($this); |
|
|
\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"> |
|
|
<div class="shop-category-view"> |
|
|
|
|
|
|
|
@ -26,14 +36,24 @@ $this->params['breadcrumbs'][] = $this->title; |
|
|
'keywords', |
|
|
'keywords', |
|
|
'desc', |
|
|
'desc', |
|
|
'sort_order', |
|
|
'sort_order', |
|
|
'icon', |
|
|
|
|
|
'filter_attr:ntext', |
|
|
|
|
|
|
|
|
['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', |
|
|
['attribute' => 'is_show', |
|
|
'width' => '5%', |
|
|
'width' => '5%', |
|
|
'value' => |
|
|
'value' => |
|
|
function ($model) { |
|
|
function ($model) { |
|
|
return $model->is_show == ShopCategory::IS_SHOW_HIDE ? '隐藏' : '显示'; |
|
|
return $model->is_show == ShopCategory::IS_SHOW_HIDE ? '隐藏' : '显示'; |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
'created_at:datetime', |
|
|
'created_at:datetime', |
|
|