From d3140650478bb7a27d334f433f23ff9f774fb040 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Mon, 25 Nov 2019 16:52:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E8=A1=A8an?= =?UTF-8?q?tgoods=5Fcategory=E7=9A=84pid=E5=AD=97=E6=AE=B5=E5=92=8Cicon?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...id_and_icon_in_table_antgoods_category.php | 26 +++++++++++++++++++ .../goods/src/models/ars/Category.php | 5 ++-- 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 vendor/antgoods/goods/src/migrations/m191125_084547_update_column_pid_and_icon_in_table_antgoods_category.php diff --git a/vendor/antgoods/goods/src/migrations/m191125_084547_update_column_pid_and_icon_in_table_antgoods_category.php b/vendor/antgoods/goods/src/migrations/m191125_084547_update_column_pid_and_icon_in_table_antgoods_category.php new file mode 100644 index 0000000..055e84c --- /dev/null +++ b/vendor/antgoods/goods/src/migrations/m191125_084547_update_column_pid_and_icon_in_table_antgoods_category.php @@ -0,0 +1,26 @@ +dropColumn('antgoods_category', 'icon'); + $this->addColumn('antgoods_category', 'icon', $this->integer(11)->defaultValue(null)->comment('图标')); + $this->dropColumn('antgoods_category', 'pid'); + $this->addColumn('antgoods_category', 'pid', $this->integer(11)->defaultValue(0)->comment('父级id')); + } + + public function down() + { + $this->dropColumn('antgoods_category', 'icon'); + $this->addColumn('antgoods_category', 'icon', $this->string(64)->defaultValue(null)->comment('图标')); + $this->dropColumn('antgoods_category', 'pid'); + $this->addColumn('antgoods_category', 'pid', $this->integer(11)->defaultValue(null)->comment('父级id')); + return true; + } +} diff --git a/vendor/antgoods/goods/src/models/ars/Category.php b/vendor/antgoods/goods/src/models/ars/Category.php index 783580b..6a50d3a 100644 --- a/vendor/antgoods/goods/src/models/ars/Category.php +++ b/vendor/antgoods/goods/src/models/ars/Category.php @@ -13,7 +13,7 @@ use yii\behaviors\TimestampBehavior; * @property int $pid 父级id * @property int $goods_count 商品数量 * @property int $sort_order 排序 - * @property string $icon 图标 + * @property int $icon 图标 * @property int $is_show 是否显示,1为不显示 * @property int $is_delete 是否删除,1为已删除 * @property int $created_at 创建时间 @@ -50,9 +50,8 @@ class Category extends \yii\db\ActiveRecord { return [ [['name'], 'required'], - [['pid', 'goods_count', 'sort_order', 'is_show', 'is_delete'], 'integer'], + [['pid', 'goods_count', 'sort_order', 'is_show', 'is_delete', 'icon'], 'integer'], [['name'], 'string', 'max' => 60], - [['icon'], 'string', 'max' => 64], [['iconImageId'], 'string'], ]; }