vip
parent
8ec8067174
commit
f93753fd7d
|
|
@ -14,13 +14,8 @@ class AddRoleToUserInfos extends Migration
|
|||
public function up()
|
||||
{
|
||||
Schema::table('user_infos', function (Blueprint $table) {
|
||||
// type: favoite, agent
|
||||
// level: v3, v2, v1
|
||||
$table->string('role')->default('')->comment('分销身份({type}-{level})');
|
||||
$table->string('role_name')->default('');
|
||||
$table->decimal('profit', 12, 2)->default(0)->comment('累计收益');
|
||||
$table->tinyInteger('is_company')->default(0)->comment('是否员工');
|
||||
$table->unsignedBigInteger('store_id')->nullable()->comment('关联门店');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddSlugToVips extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('vips', function (Blueprint $table) {
|
||||
$table->string('slug')->comment('标识');
|
||||
$table->unsignedInteger('sort')->comment('等级');
|
||||
$table->integer('ratio')->comment('返佣比例, 10 => 10%');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('vips', function (Blueprint $table) {
|
||||
$table->dropColumn(['slug', 'ratio']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
use App\Models\Vip;
|
||||
|
||||
class VipSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
$list = [
|
||||
['name' => '省级代理', 'slug' => 'agent', 'sort' => 1]
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue