From 03327181254883a40e556c071de73551737c5e3c Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Fri, 29 Nov 2019 14:43:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=89=8D=E7=AB=AF=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E5=88=97=E8=A1=A8=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/controllers/ShopCategoryController.php | 1 + vendor/antgoods/goods/src/models/ars/Category.php | 1 - .../antgoods/goods/src/models/ars/ShopCategory.php | 2 -- .../goods/src/models/searchs/GoodsSearch.php | 2 +- .../goods/src/views/shop-category/view.php | 14 +++++++++----- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/vendor/antgoods/goods/src/controllers/ShopCategoryController.php b/vendor/antgoods/goods/src/controllers/ShopCategoryController.php index b9ea0c3..e42d37e 100644 --- a/vendor/antgoods/goods/src/controllers/ShopCategoryController.php +++ b/vendor/antgoods/goods/src/controllers/ShopCategoryController.php @@ -79,6 +79,7 @@ class ShopCategoryController extends Controller public function actionCreate() { $model = new ShopCategory(); + $model->is_show = ShopCategory::IS_SHOW_HIDE; if ($model->load(Yii::$app->request->post())) { if ($model->filter_attr != null && is_array($model->filter_attr)) { diff --git a/vendor/antgoods/goods/src/models/ars/Category.php b/vendor/antgoods/goods/src/models/ars/Category.php index 7dbc2a8..6cf6bec 100644 --- a/vendor/antgoods/goods/src/models/ars/Category.php +++ b/vendor/antgoods/goods/src/models/ars/Category.php @@ -68,7 +68,6 @@ class Category extends \yii\db\ActiveRecord 'pid' => '父级id', 'goods_count' => '商品数量', 'sort_order' => '排序', - 'icon_type' => '图标类型', 'icon' => '图标', 'is_show' => '是否显示', 'is_delete' => '是否删除,1为已删除', diff --git a/vendor/antgoods/goods/src/models/ars/ShopCategory.php b/vendor/antgoods/goods/src/models/ars/ShopCategory.php index a02d51a..5654a5a 100644 --- a/vendor/antgoods/goods/src/models/ars/ShopCategory.php +++ b/vendor/antgoods/goods/src/models/ars/ShopCategory.php @@ -15,7 +15,6 @@ use yii\behaviors\TimestampBehavior; * @property string $keywords 关键字 * @property string $desc 描述 * @property int $sort_order 排序 - * @property int $icon_type 图标类型 * @property string $icon 图标 * @property string $filter_attr 筛选属性 * @property int $is_show 是否显示,1为不显示 @@ -75,7 +74,6 @@ class ShopCategory extends \yii\db\ActiveRecord 'keywords' => '关键字', 'desc' => '描述', 'sort_order' => '排序', - 'icon_type' => '图标类型', 'icon' => '图标', 'filter_attr' => '筛选属性', 'is_show' => '是否显示', diff --git a/vendor/antgoods/goods/src/models/searchs/GoodsSearch.php b/vendor/antgoods/goods/src/models/searchs/GoodsSearch.php index 0420f7b..86106b8 100644 --- a/vendor/antgoods/goods/src/models/searchs/GoodsSearch.php +++ b/vendor/antgoods/goods/src/models/searchs/GoodsSearch.php @@ -100,7 +100,7 @@ class GoodsSearch extends Goods 'width' => '5%', 'value' => function ($model) { - return $model->is_sale ? Goods::$isSale[$model->is_sale] : '未设置'; + return $model->is_sale==Goods::IS_SALE_YES ? '在售' : '不在售'; }, ], diff --git a/vendor/antgoods/goods/src/views/shop-category/view.php b/vendor/antgoods/goods/src/views/shop-category/view.php index 7157fb0..c4d61dc 100644 --- a/vendor/antgoods/goods/src/views/shop-category/view.php +++ b/vendor/antgoods/goods/src/views/shop-category/view.php @@ -2,6 +2,7 @@ use yii\helpers\Html; use yii\widgets\DetailView; +use antgoods\goods\models\ars\ShopCategory; /* @var $this yii\web\View */ /* @var $model antgoods\goods\models\ars\ShopCategory */ @@ -22,16 +23,19 @@ $this->params['breadcrumbs'][] = $this->title; 'attributes' => [ 'id', 'name', - 'pid', - 'goods_count', 'keywords', 'desc', 'sort_order', - 'icon_type', 'icon', 'filter_attr:ntext', - 'is_show', - 'is_delete', + ['attribute' => 'is_show', + 'width' => '5%', + 'value' => + function ($model) { + return $model->is_show == ShopCategory::IS_SHOW_HIDE ? '隐藏' : '显示'; + + }, + ], 'created_at:datetime', 'updated_at:datetime', ],