From 9c55344af384cd686ce54616edfe1b95b36e051b Mon Sep 17 00:00:00 2001 From: linyaostalker <602604991@qq.com> Date: Thu, 5 Dec 2019 19:21:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=90=E8=B4=B9=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E9=80=BB=E8=BE=91=EF=BC=8C=E5=88=A0=E9=99=A4=E5=85=B6?= =?UTF-8?q?=E4=B8=AD=E6=97=A0=E7=94=A8=E7=9A=84=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=9B=E5=BB=BA=E8=BF=90=E8=B4=B9=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E4=BB=B7=E6=A0=BC=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ra_price_in_table_ats_express_template.php | 32 +++++++++++++++++ ...5_092942_create_table_ats_express_area.php | 36 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 backend/modules/shop/migrations/m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template.php create mode 100644 backend/modules/shop/migrations/m191205_092942_create_table_ats_express_area.php diff --git a/backend/modules/shop/migrations/m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template.php b/backend/modules/shop/migrations/m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template.php new file mode 100644 index 0000000..a0859df --- /dev/null +++ b/backend/modules/shop/migrations/m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template.php @@ -0,0 +1,32 @@ +dropColumn('ats_express_template', 'province'); + $this->dropColumn('ats_express_template', 'city'); + $this->dropColumn('ats_express_template', 'area'); + $this->dropColumn('ats_express_template', 'extra_price'); + $this->dropColumn('ats_express_template', 'basic_price'); + $this->dropColumn('ats_express_template', 'basic_count'); + $this->dropColumn('ats_express_template', 'extra_count'); + } + + public function down() + { + $this->addColumn('ats_express_template', 'province', $this->text()->comment('省份')); + $this->addColumn('ats_express_template', 'city', $this->text()->comment('城市')); + $this->addColumn('ats_express_template', 'area', $this->text()->comment('区域')); + $this->addColumn('ats_express_template', 'extra_price', $this->integer(20)->defaultValue(null)->comment('续重运费')); + $this->addColumn('ats_express_template', 'basic_price', $this->integer(20)->defaultValue(null)->comment('基本运费')); + $this->addColumn('ats_express_template', 'basic_count', $this->integer(20)->defaultValue(null)->comment('基本数量')); + $this->addColumn('ats_express_template', 'extra_count', $this->integer(20)->defaultValue(null)->comment('续重数量')); + return true; + } +} diff --git a/backend/modules/shop/migrations/m191205_092942_create_table_ats_express_area.php b/backend/modules/shop/migrations/m191205_092942_create_table_ats_express_area.php new file mode 100644 index 0000000..bd50a85 --- /dev/null +++ b/backend/modules/shop/migrations/m191205_092942_create_table_ats_express_area.php @@ -0,0 +1,36 @@ +createTable('ats_express_area', [ + 'id' => $this->primaryKey(), + 'province' => $this->text()->comment('省份'), + 'city' => $this->text()->comment('城市'), + 'area' => $this->text()->comment('区域'), + 'express_template' => $this->integer(11)->defaultValue(null)->comment('运费模板id'), + 'extra_price' => $this->integer(20)->defaultValue(null)->comment('续重运费'), + 'basic_price' => $this->integer(20)->defaultValue(null)->comment('基本运费'), + 'basic_count' => $this->integer(20)->defaultValue(null)->comment('基本数量'), + 'extra_count' => $this->integer(20)->defaultValue(null)->comment('续重数量'), + 'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'), + 'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'), + ],$tableOptions); + } + + /** + * {@inheritdoc} + */ + public function down() + { + $this->dropTable('ats_express_area'); + return true; + } +}