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; + } +}