From 7245c267dca74a41a13bb43b134eaaaab75a5d40 Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Tue, 17 Dec 2019 17:24:08 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=95=86=E5=93=81sku=E8=A1=A8=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0sku=E5=9B=BE=E7=89=87id=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...olumn_sku_image_in_table_atg_goods_sku.php | 26 +++++++++++++++++++ backend/modules/goods/models/ars/GoodsSku.php | 8 +++--- 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 backend/modules/goods/migrations/m191217_092101_add_column_sku_image_in_table_atg_goods_sku.php diff --git a/backend/modules/goods/migrations/m191217_092101_add_column_sku_image_in_table_atg_goods_sku.php b/backend/modules/goods/migrations/m191217_092101_add_column_sku_image_in_table_atg_goods_sku.php new file mode 100644 index 0000000..3ae6b83 --- /dev/null +++ b/backend/modules/goods/migrations/m191217_092101_add_column_sku_image_in_table_atg_goods_sku.php @@ -0,0 +1,26 @@ +addColumn('atg_goods_sku', 'sku_image', $this->integer(11)->notNull()->defaultValue("0")->comment('sku图片id')); + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->dropColumn('atg_goods_sku', 'sku_image'); + return true; + } +} diff --git a/backend/modules/goods/models/ars/GoodsSku.php b/backend/modules/goods/models/ars/GoodsSku.php index 68bf7e9..21e1348 100755 --- a/backend/modules/goods/models/ars/GoodsSku.php +++ b/backend/modules/goods/models/ars/GoodsSku.php @@ -23,12 +23,13 @@ use yii\behaviors\TimestampBehavior; * @property int $is_delete 是否删除,1为已删除 * @property int $created_at 创建时间 * @property int $updated_at 更新时间 - * @property int $is_manaul 是否手动 + * @property int $is_manual 是否手动 * @property int $weight 重量 + * @property int $sku_image sku图片id */ class GoodsSku extends \yii\db\ActiveRecord { - //是否手动is_manaul + //是否手动is_manual const IS_MANUAL_YES = 1; //是手动 const IS_MANUAL_NO = 0; //不是手动 //是否删除is_delete @@ -49,7 +50,7 @@ class GoodsSku extends \yii\db\ActiveRecord { return [ [['goods_id', 'goods_sn'], 'required'], - [['goods_id', 'sold_count', 'stock', 'market_price', 'price', 'model_id', 'is_sale', 'sort_order', 'is_delete', 'is_manaul'], 'integer'], + [['goods_id', 'sold_count', 'stock', 'market_price', 'price', 'model_id', 'is_sale', 'sort_order', 'is_delete', 'is_manual', 'sku_image'], 'integer'], [['goods_code'], 'string', 'max' => 50], [['goods_sn', 'goods_attr'], 'string', 'max' => 60], [['weight'], 'safe'] @@ -78,6 +79,7 @@ class GoodsSku extends \yii\db\ActiveRecord 'created_at' => '创建时间', 'updated_at' => '更新时间', 'weight' => '重量', + 'sku_image' => 'sku图片id', ]; }