From f93753fd7d90bec7c97219c688068e04b3cbc9a0 Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Sat, 7 May 2022 17:52:39 +0800 Subject: [PATCH] vip --- ...22_05_06_133819_add_role_to_user_infos.php | 5 --- .../2022_05_07_174547_add_slug_to_vips.php | 34 +++++++++++++++++++ database/seeders/VipSeeder.php | 21 ++++++++++++ 3 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 database/migrations/2022_05_07_174547_add_slug_to_vips.php create mode 100644 database/seeders/VipSeeder.php diff --git a/database/migrations/2022_05_06_133819_add_role_to_user_infos.php b/database/migrations/2022_05_06_133819_add_role_to_user_infos.php index 896c6480..1b8fffd5 100644 --- a/database/migrations/2022_05_06_133819_add_role_to_user_infos.php +++ b/database/migrations/2022_05_06_133819_add_role_to_user_infos.php @@ -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('关联门店'); }); } diff --git a/database/migrations/2022_05_07_174547_add_slug_to_vips.php b/database/migrations/2022_05_07_174547_add_slug_to_vips.php new file mode 100644 index 00000000..1b44df7e --- /dev/null +++ b/database/migrations/2022_05_07_174547_add_slug_to_vips.php @@ -0,0 +1,34 @@ +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']); + }); + } +} diff --git a/database/seeders/VipSeeder.php b/database/seeders/VipSeeder.php new file mode 100644 index 00000000..311a9712 --- /dev/null +++ b/database/seeders/VipSeeder.php @@ -0,0 +1,21 @@ + '省级代理', 'slug' => 'agent', 'sort' => 1] + ]; + } +}