From da2bda6d0d3e0e65b3afb95fe52909241dd2ff1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=9D=99?= Date: Thu, 23 Dec 2021 11:54:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E8=B4=B9=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...add_sales_value_to_product_spus_table.php} | 7 ++-- ...add_sales_value_to_product_skus_table.php} | 7 ++-- ...dd_sales_value_to_order_products_table.php | 32 +++++++++++++++++++ ...115137_add_sales_value_to_orders_table.php | 32 +++++++++++++++++++ 4 files changed, 70 insertions(+), 8 deletions(-) rename database/migrations/{2021_12_22_152013_add_growth_value_to_product_spus_table.php => 2021_12_22_152013_add_sales_value_to_product_spus_table.php} (71%) rename database/migrations/{2021_12_22_152034_add_growth_value_to_product_skus_table.php => 2021_12_22_152034_add_sales_value_to_product_skus_table.php} (71%) create mode 100644 database/migrations/2021_12_23_113617_add_sales_value_to_order_products_table.php create mode 100644 database/migrations/2021_12_23_115137_add_sales_value_to_orders_table.php diff --git a/database/migrations/2021_12_22_152013_add_growth_value_to_product_spus_table.php b/database/migrations/2021_12_22_152013_add_sales_value_to_product_spus_table.php similarity index 71% rename from database/migrations/2021_12_22_152013_add_growth_value_to_product_spus_table.php rename to database/migrations/2021_12_22_152013_add_sales_value_to_product_spus_table.php index 463ee9b3..044d5808 100644 --- a/database/migrations/2021_12_22_152013_add_growth_value_to_product_spus_table.php +++ b/database/migrations/2021_12_22_152013_add_sales_value_to_product_spus_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class AddGrowthValueToProductSpusTable extends Migration +class AddSalesValueToProductSpusTable extends Migration { /** * Run the migrations. @@ -14,8 +14,7 @@ class AddGrowthValueToProductSpusTable extends Migration public function up() { Schema::table('product_spus', function (Blueprint $table) { - // - $table->unsignedBigInteger('growth_value')->default(0)->comment('等级成长值'); + $table->unsignedDecimal('sales_value', 18, 2)->default(0.00)->comment('销售值'); }); } @@ -28,7 +27,7 @@ class AddGrowthValueToProductSpusTable extends Migration { Schema::table('product_spus', function (Blueprint $table) { // - $table->dropColumn('product_spus'); + $table->dropColumn(['sales_value']); }); } } diff --git a/database/migrations/2021_12_22_152034_add_growth_value_to_product_skus_table.php b/database/migrations/2021_12_22_152034_add_sales_value_to_product_skus_table.php similarity index 71% rename from database/migrations/2021_12_22_152034_add_growth_value_to_product_skus_table.php rename to database/migrations/2021_12_22_152034_add_sales_value_to_product_skus_table.php index 586eb8ca..2bbbf449 100644 --- a/database/migrations/2021_12_22_152034_add_growth_value_to_product_skus_table.php +++ b/database/migrations/2021_12_22_152034_add_sales_value_to_product_skus_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class AddGrowthValueToProductSkusTable extends Migration +class AddSalesValueToProductSkusTable extends Migration { /** * Run the migrations. @@ -14,8 +14,7 @@ class AddGrowthValueToProductSkusTable extends Migration public function up() { Schema::table('product_skus', function (Blueprint $table) { - // - $table->unsignedBigInteger('growth_value')->default(0)->comment('等级成长值'); + $table->unsignedDecimal('sales_value', 18, 2)->default(0.00)->comment('销售值'); }); } @@ -28,7 +27,7 @@ class AddGrowthValueToProductSkusTable extends Migration { Schema::table('product_skus', function (Blueprint $table) { // - $table->dropColumn('product_skus'); + $table->dropColumn(['sales_value']); }); } } diff --git a/database/migrations/2021_12_23_113617_add_sales_value_to_order_products_table.php b/database/migrations/2021_12_23_113617_add_sales_value_to_order_products_table.php new file mode 100644 index 00000000..00ed6157 --- /dev/null +++ b/database/migrations/2021_12_23_113617_add_sales_value_to_order_products_table.php @@ -0,0 +1,32 @@ +unsignedDecimal('sales_value', 18, 2)->default(0.00)->comment('销售值'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('order_products', function (Blueprint $table) { + $table->dropColumn(['sales_value']); + }); + } +} diff --git a/database/migrations/2021_12_23_115137_add_sales_value_to_orders_table.php b/database/migrations/2021_12_23_115137_add_sales_value_to_orders_table.php new file mode 100644 index 00000000..e376f99f --- /dev/null +++ b/database/migrations/2021_12_23_115137_add_sales_value_to_orders_table.php @@ -0,0 +1,32 @@ +unsignedDecimal('sales_value', 18, 2)->default(0.00)->comment('总销售值'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('orders', function (Blueprint $table) { + $table->dropColumn(['sales_value']); + }); + } +}