|
@ -1,7 +1,9 @@ |
|
|
<?php |
|
|
<?php |
|
|
|
|
|
|
|
|
use yii\helpers\Html; |
|
|
|
|
|
|
|
|
use antgoods\goods\models\ars\Goods; |
|
|
|
|
|
use yii\bootstrap4\Html; |
|
|
use yii\widgets\DetailView; |
|
|
use yii\widgets\DetailView; |
|
|
|
|
|
use common\models\ars\File; |
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */ |
|
|
/* @var $this yii\web\View */ |
|
|
/* @var $model antgoods\goods\models\ars\Goods */ |
|
|
/* @var $model antgoods\goods\models\ars\Goods */ |
|
@ -21,36 +23,88 @@ $this->params['breadcrumbs'][] = $this->title; |
|
|
'model' => $model, |
|
|
'model' => $model, |
|
|
'attributes' => [ |
|
|
'attributes' => [ |
|
|
'id', |
|
|
'id', |
|
|
'pid', |
|
|
|
|
|
'cat_id', |
|
|
|
|
|
'brand_id', |
|
|
|
|
|
'shop_cat_id', |
|
|
|
|
|
'name', |
|
|
'name', |
|
|
'sn', |
|
|
'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', |
|
|
'code', |
|
|
'supplier_id', |
|
|
|
|
|
|
|
|
[ |
|
|
|
|
|
'attribute' => 'supplier_id', |
|
|
|
|
|
'width' => '10%', |
|
|
|
|
|
'value' => function ($model) { |
|
|
|
|
|
return $model->supplier ? $model->supplier->name : ''; |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
'weight', |
|
|
'weight', |
|
|
'length', |
|
|
'length', |
|
|
'width', |
|
|
'width', |
|
|
'height', |
|
|
'height', |
|
|
'diameter', |
|
|
'diameter', |
|
|
'unit', |
|
|
'unit', |
|
|
'sold_count', |
|
|
|
|
|
'limit_count', |
|
|
|
|
|
'stock', |
|
|
|
|
|
'stock_warn', |
|
|
|
|
|
|
|
|
[ |
|
|
|
|
|
'attribute' => 'stock', |
|
|
|
|
|
'width' => '5%', |
|
|
|
|
|
'value' => function ($model) { |
|
|
|
|
|
if ($model->stock == -1) { |
|
|
|
|
|
return '未开启'; |
|
|
|
|
|
} else { |
|
|
|
|
|
return $model->stock; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
'market_price', |
|
|
'market_price', |
|
|
'price', |
|
|
'price', |
|
|
'brief', |
|
|
'brief', |
|
|
'description:ntext', |
|
|
|
|
|
'image', |
|
|
|
|
|
'model_id', |
|
|
|
|
|
'is_sale', |
|
|
|
|
|
|
|
|
['attribute' => 'image', |
|
|
|
|
|
'format' => 'raw', |
|
|
|
|
|
'value' => function ($model) { |
|
|
|
|
|
return $model->image ? |
|
|
|
|
|
Html::img(['/'.$model->imageFile->path], ['style' => 'width:80px']) |
|
|
|
|
|
: '<div class="table_not_setting">未设置</div>'; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'label' => '详情图', |
|
|
|
|
|
'format' => 'raw', |
|
|
|
|
|
'value' => function ($model) { |
|
|
|
|
|
$image = ''; |
|
|
|
|
|
$imgs = File::findAll(['own_id' => $model->id, 'own_type' => File::OWN_TYPE_GOODS_DETAILS, 'is_delete' => File::IS_DELETE_NO]); |
|
|
|
|
|
foreach ($imgs as $img) { |
|
|
|
|
|
$image .= Html::img(['/'.$img->path], ['style' => 'width:150px']); |
|
|
|
|
|
} |
|
|
|
|
|
return $image; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
|
|
|
['attribute' => 'is_sale', |
|
|
|
|
|
'width' => '5%', |
|
|
|
|
|
'value' => |
|
|
|
|
|
function ($model) { |
|
|
|
|
|
return $model->is_sale ? Goods::$isSale[$model->is_sale] : '未设置'; |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
'sort_order', |
|
|
'sort_order', |
|
|
'bouns_points', |
|
|
|
|
|
'experience_points', |
|
|
|
|
|
'is_delete', |
|
|
|
|
|
'express_template', |
|
|
|
|
|
'created_at:datetime', |
|
|
'created_at:datetime', |
|
|
'updated_at:datetime', |
|
|
'updated_at:datetime', |
|
|
], |
|
|
], |
|
|