6
0
Fork 0

消费值

release
李静 2021-12-23 11:54:10 +08:00
parent d24ff38576
commit da2bda6d0d
4 changed files with 70 additions and 8 deletions

View File

@ -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']);
});
}
}

View File

@ -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']);
});
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddSalesValueToOrderProductsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('order_products', function (Blueprint $table) {
$table->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']);
});
}
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddSalesValueToOrdersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('orders', function (Blueprint $table) {
$table->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']);
});
}
}