From 8052d0e4d3815c0cec593752c4bf3c7db372c94b Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Sat, 30 Nov 2019 15:22:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=95=86=E5=93=81=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=87=8D=E9=87=8F=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/models/ars/OrderGoods.php | 4 +++- ...column_weight_in_table_ats_order_goods.php | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 console/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php diff --git a/common/models/ars/OrderGoods.php b/common/models/ars/OrderGoods.php index fa4d65d..a1f647d 100644 --- a/common/models/ars/OrderGoods.php +++ b/common/models/ars/OrderGoods.php @@ -19,6 +19,7 @@ use yii\behaviors\TimestampBehavior; * @property int $market_price 市场价 * @property int $updated_at 更新时间 * @property int $created_at 创建时间 + * @property int $weight 重量 */ class OrderGoods extends \yii\db\ActiveRecord { @@ -37,7 +38,7 @@ class OrderGoods extends \yii\db\ActiveRecord { return [ [['order_id', 'goods_id'], 'required'], - [['order_id', 'goods_id', 'goods_img', 'goods_count', 'price', 'market_price'], 'integer'], + [['order_id', 'goods_id', 'goods_img', 'goods_count', 'price', 'market_price', 'weight'], 'integer'], [['goods_name', 'sku_value'], 'string', 'max' => 120], ]; } @@ -59,6 +60,7 @@ class OrderGoods extends \yii\db\ActiveRecord 'market_price' => '市场价', 'updated_at' => '更新时间', 'created_at' => '创建时间', + 'weight' => '重量', ]; } diff --git a/console/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php b/console/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php new file mode 100644 index 0000000..da1c6cc --- /dev/null +++ b/console/migrations/m191130_071623_add_column_weight_in_table_ats_order_goods.php @@ -0,0 +1,20 @@ +addColumn('ats_order_goods', 'weight', $this->integer(11)->defaultValue(0)->unsigned()->comment('重量')); + } + + public function down() + { + $this->dropColumn('ats_order_goods', 'weight'); + return true; + } +}