diff --git a/vendor/antgoods/goods/src/models/ars/ShopCategory.php b/vendor/antgoods/goods/src/models/ars/ShopCategory.php index 5654a5a..0237be6 100644 --- a/vendor/antgoods/goods/src/models/ars/ShopCategory.php +++ b/vendor/antgoods/goods/src/models/ars/ShopCategory.php @@ -4,6 +4,7 @@ namespace antgoods\goods\models\ars; use Yii; use yii\behaviors\TimestampBehavior; +use common\models\ars\File; /** * This is the model class for table "antgoods_shop_category". @@ -113,4 +114,9 @@ class ShopCategory extends \yii\db\ActiveRecord { return $column = self::find()->select(['name'])->where(['is_delete' => self::IS_DELETE_NO])->indexBy('id')->column(); } + + public function getIconFile() + { + return $this->hasOne(File::className(), ['id' => 'icon']); + } } diff --git a/vendor/antgoods/goods/src/models/searchs/BrandSearch.php b/vendor/antgoods/goods/src/models/searchs/BrandSearch.php index be249ca..48f8fa5 100644 --- a/vendor/antgoods/goods/src/models/searchs/BrandSearch.php +++ b/vendor/antgoods/goods/src/models/searchs/BrandSearch.php @@ -57,6 +57,19 @@ class BrandSearch extends Brand [ 'class' => 'iron\grid\ActionColumn', 'align' => 'center', + 'config' => [ + [ + 'name' => 'update', + 'icon' => 'pencil', + 'title' => '修改' + ], + [ + 'name' => 'delete', + 'icon' => 'trash', + 'title' => '删除', + 'contents' => '确定删除?' + ] + ], ], ]; } diff --git a/vendor/antgoods/goods/src/models/searchs/SupplierSearch.php b/vendor/antgoods/goods/src/models/searchs/SupplierSearch.php index fd68feb..6e5ffd5 100644 --- a/vendor/antgoods/goods/src/models/searchs/SupplierSearch.php +++ b/vendor/antgoods/goods/src/models/searchs/SupplierSearch.php @@ -63,6 +63,19 @@ class SupplierSearch extends Supplier [ 'class' => 'iron\grid\ActionColumn', 'align' => 'center', + 'config' => [ + [ + 'name' => 'update', + 'icon' => 'pencil', + 'title' => '修改' + ], + [ + 'name' => 'delete', + 'icon' => 'trash', + 'title' => '删除', + 'contents' => '确定删除?' + ] + ], ], ]; } diff --git a/vendor/antgoods/goods/src/views/shop-category/view.php b/vendor/antgoods/goods/src/views/shop-category/view.php index c4d61dc..97078fc 100644 --- a/vendor/antgoods/goods/src/views/shop-category/view.php +++ b/vendor/antgoods/goods/src/views/shop-category/view.php @@ -3,6 +3,7 @@ use yii\helpers\Html; use yii\widgets\DetailView; use antgoods\goods\models\ars\ShopCategory; +use antgoods\goods\models\ars\Attribute; /* @var $this yii\web\View */ /* @var $model antgoods\goods\models\ars\ShopCategory */ @@ -11,6 +12,15 @@ $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); ?>
@@ -26,14 +36,24 @@ $this->params['breadcrumbs'][] = $this->title; 'keywords', 'desc', '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', 'width' => '5%', 'value' => function ($model) { return $model->is_show == ShopCategory::IS_SHOW_HIDE ? '隐藏' : '显示'; - }, ], 'created_at:datetime',