6
0
Fork 0
release
李静 2022-01-16 20:33:58 +08:00
parent e891d20f05
commit 7e427008f5
4 changed files with 0 additions and 140 deletions

View File

@ -1,44 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDealerEarningsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('dealer_earnings', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id');
$table->unsignedDecimal('total_amount', 10, 2)->comment('补贴总金额');
$table->unsignedDecimal('fee', 10, 2)->default(0)->comment('手续费');
$table->unsignedDecimal('fee_rate', 4, 2)->default(0)->comment('手续费率(百分比)');
$table->tinyInteger('type')->comment('类型: 1=>管理津贴, 2=>管理者补贴, 3=>进货补贴, 4=>渠道补贴');
$table->timestamp('start_at')->comment('结算开始时间');
$table->timestamp('end_at')->comment('结算结束时间');
$table->tinyInteger('status')->default(0)->comment('状态: 0 待处理, 5 已付款');
$table->timestamp('completed_at')->nullable()->comment('完成时间');
$table->timestamps();
$table->unique(['user_id', 'type', 'start_at', 'end_at']);
$table->index(['start_at', 'end_at']);
$table->index('type');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('dealer_earnings');
}
}

View File

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddIsManagerToDealerEarningsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('dealer_earnings', function (Blueprint $table) {
$table->boolean('is_manager')->default(false)->comment('是否是管理者');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('dealer_earnings', function (Blueprint $table) {
$table->dropColumn('is_manager');
});
}
}

View File

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddLvlToDealerEarningsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('dealer_earnings', function (Blueprint $table) {
$table->tinyInteger('lvl')->comment('经销商等级');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('dealer_earnings', function (Blueprint $table) {
$table->dropColumn('lvl');
});
}
}

View File

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddDescriptionToDealerEarningsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('dealer_earnings', function (Blueprint $table) {
$table->text('description')->nullable()->comment('描述');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('dealer_earnings', function (Blueprint $table) {
$table->dropColumn('description');
});
}
}