title = $model->name; $this->params['breadcrumbs'][] = ['label' => '商品管理', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; \yii\web\YiiAsset::register($this); ?>
= Html::a('返回列表', ['index'], ['class' => 'btn btn-success']) ?>
= DetailView::widget([ 'model' => $model, 'attributes' => [ 'id', 'name', 'sn', [ 'attribute' => 'cat_id', 'width' => '10%', 'value' => function ($model) { return $model->category ? $model->category->name : ''; }, ], [ 'attribute' => 'shop_cat_id', 'width' => '10%', 'value' => function ($model) { return $model->shopCategory ? $model->shopCategory->name : ''; }, ], [ 'attribute' => 'brand_id', 'width' => '10%', 'value' => function ($model) { return $model->brand ? $model->brand->name : ''; }, ], 'code', [ 'attribute' => 'supplier_id', 'width' => '10%', 'value' => function ($model) { return $model->supplier ? $model->supplier->name : ''; }, ], 'weight', 'length', 'width', 'height', 'diameter', 'unit', [ 'attribute' => 'stock', 'width' => '5%', 'value' => function ($model) { if ($model->stock == -1) { return '未开启'; } else { return $model->stock; } }, ], 'market_price', 'price', 'brief', ['attribute' => 'image', 'format' => 'raw', 'value' => function ($model) { return $model->image ? Html::img(['/'.$model->imageFile->path], ['style' => 'width:80px']) : '