diff --git a/vendor/antgoods/goods/src/migrations/m191125_104137_drop_column_icon_type_in_table_antgoods_shop_category.php b/vendor/antgoods/goods/src/migrations/m191125_104137_drop_column_icon_type_in_table_antgoods_shop_category.php new file mode 100644 index 0000000..2f182eb --- /dev/null +++ b/vendor/antgoods/goods/src/migrations/m191125_104137_drop_column_icon_type_in_table_antgoods_shop_category.php @@ -0,0 +1,20 @@ +<?php + +use yii\db\Migration; + +/** + * Class m191125_104137_drop_column_icon_type_in_table_antgoods_shop_category + */ +class m191125_104137_drop_column_icon_type_in_table_antgoods_shop_category extends Migration +{ + public function up() + { + $this->dropColumn('antgoods_shop_category', 'icon_type'); + } + + public function down() + { + $this->addColumn('antgoods_shop_category', 'icon_type', $this->tinyInteger(1)->defaultValue(null)->comment('图标类型')); + return true; + } +} diff --git a/vendor/antgoods/goods/src/migrations/m191125_104510_update_column_pid_and_icon_in_table_antgoods_shop_category.php b/vendor/antgoods/goods/src/migrations/m191125_104510_update_column_pid_and_icon_in_table_antgoods_shop_category.php new file mode 100644 index 0000000..b1536ac --- /dev/null +++ b/vendor/antgoods/goods/src/migrations/m191125_104510_update_column_pid_and_icon_in_table_antgoods_shop_category.php @@ -0,0 +1,26 @@ +<?php + +use yii\db\Migration; + +/** + * Class m191125_104510_update_column_pid_and_icon_in_table_antgoods_shop_category + */ +class m191125_104510_update_column_pid_and_icon_in_table_antgoods_shop_category extends Migration +{ + public function up() + { + $this->dropColumn('antgoods_shop_category', 'icon'); + $this->addColumn('antgoods_shop_category', 'icon', $this->integer(11)->defaultValue(null)->comment('图标')); + $this->dropColumn('antgoods_shop_category', 'pid'); + $this->addColumn('antgoods_shop_category', 'pid', $this->integer(11)->defaultValue(0)->comment('父级id')); + } + + public function down() + { + $this->dropColumn('antgoods_shop_category', 'icon'); + $this->addColumn('antgoods_shop_category', 'icon', $this->string(64)->defaultValue(null)->comment('图标')); + $this->dropColumn('antgoods_shop_category', 'pid'); + $this->addColumn('antgoods_shop_category', 'pid', $this->integer(11)->defaultValue(null)->comment('父级id')); + return true; + } +} diff --git a/vendor/antgoods/goods/src/models/searchs/CategorySearch.php b/vendor/antgoods/goods/src/models/searchs/CategorySearch.php index cce94b0..868afe6 100644 --- a/vendor/antgoods/goods/src/models/searchs/CategorySearch.php +++ b/vendor/antgoods/goods/src/models/searchs/CategorySearch.php @@ -26,8 +26,8 @@ class CategorySearch extends Category public function rules() { return [ - [['id', 'pid', 'goods_count', 'sort_order', 'icon_type', 'is_show', 'is_delete', 'created_at', 'updated_at'], 'integer'], - [['name', 'icon'], 'safe'], + [['id', 'pid', 'goods_count', 'sort_order', 'is_show', 'is_delete', 'created_at', 'updated_at', 'icon'], 'integer'], + [['name'], 'safe'], ['created_at_range','safe'], ]; } @@ -57,7 +57,6 @@ class CategorySearch extends Category 'pid', 'goods_count', 'sort_order', - //'icon_type', //'icon', //'is_show', //'is_delete', @@ -134,15 +133,14 @@ class CategorySearch extends Category 'pid' => $this->pid, 'goods_count' => $this->goods_count, 'sort_order' => $this->sort_order, - 'icon_type' => $this->icon_type, 'is_show' => $this->is_show, 'is_delete' => $this->is_delete, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, + 'icon' => $this->icon, ]); - $query->andFilterWhere(['like', 'name', $this->name]) - ->andFilterWhere(['like', 'icon', $this->icon]); + $query->andFilterWhere(['like', 'name', $this->name]); if ($this->created_at_range) { $arr = explode(' ~ ', $this->created_at_range); $start = strtotime($arr[0]); diff --git a/vendor/antgoods/goods/src/models/searchs/ShopCategorySearch.php b/vendor/antgoods/goods/src/models/searchs/ShopCategorySearch.php index 524eb11..2e5dcfc 100644 --- a/vendor/antgoods/goods/src/models/searchs/ShopCategorySearch.php +++ b/vendor/antgoods/goods/src/models/searchs/ShopCategorySearch.php @@ -26,8 +26,8 @@ class ShopCategorySearch extends ShopCategory public function rules() { return [ - [['id', 'pid', 'goods_count', 'sort_order', 'icon_type', 'is_show', 'is_delete', 'created_at', 'updated_at'], 'integer'], - [['name', 'keywords', 'desc', 'icon', 'filter_attr'], 'safe'], + [['id', 'pid', 'goods_count', 'sort_order', 'is_show', 'is_delete', 'created_at', 'updated_at', 'icon'], 'integer'], + [['name', 'keywords', 'desc', 'filter_attr'], 'safe'], ['created_at_range','safe'], ]; } @@ -136,7 +136,7 @@ class ShopCategorySearch extends ShopCategory 'pid' => $this->pid, 'goods_count' => $this->goods_count, 'sort_order' => $this->sort_order, - 'icon_type' => $this->icon_type, + 'icon' => $this->icon, 'is_show' => $this->is_show, 'is_delete' => $this->is_delete, 'created_at' => $this->created_at, @@ -146,7 +146,6 @@ class ShopCategorySearch extends ShopCategory $query->andFilterWhere(['like', 'name', $this->name]) ->andFilterWhere(['like', 'keywords', $this->keywords]) ->andFilterWhere(['like', 'desc', $this->desc]) - ->andFilterWhere(['like', 'icon', $this->icon]) ->andFilterWhere(['like', 'filter_attr', $this->filter_attr]); if ($this->created_at_range) { $arr = explode(' ~ ', $this->created_at_range); diff --git a/vendor/antgoods/goods/src/views/shopcategory/_form.php b/vendor/antgoods/goods/src/views/shopcategory/_form.php index 155b9d3..97a9d30 100644 --- a/vendor/antgoods/goods/src/views/shopcategory/_form.php +++ b/vendor/antgoods/goods/src/views/shopcategory/_form.php @@ -15,16 +15,12 @@ use blobt\widgets\Icheck; <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?> - <?= $form->field($model, 'goods_count')->textInput() ?> - <?= $form->field($model, 'keywords')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'desc')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'sort_order')->textInput() ?> - <?= $form->field($model, 'icon_type')->textInput() ?> - <?= $form->field($model, 'icon')->textInput(['maxlength' => true]) ?> <?= $form->field($model, 'filter_attr')->textarea(['rows' => 6]) ?>