醉梦人间三千年 7 månader sedan
förälder
incheckning
c0491c8ada

+ 1 - 1
.env

@@ -4,7 +4,7 @@ APP_KEY=base64:tXBuLJEDanur8QpVucLgqSpvCJvjQAA5ngxD/vMHwjM=
 APP_DEBUG=true
 APP_TIMEZONE=UTC
 APP_URL=http://localhost:8000
-FRONTEND_URL=http://127.0.0.1
+FRONTEND_URL=http://127.0.0.1:8080
 
 APP_LOCALE=en
 APP_FALLBACK_LOCALE=en

+ 35 - 0
app/Http/Controllers/Backend/Server/Member/ConfigController.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace App\Http\Controllers\Backend\Server\Member;
+
+use App\Http\Controllers\Controller;
+use App\Http\Requests\Backend\Server\System\UserRequest;
+use App\Http\Services\Backend\Server\Member\ConfigService;
+use App\Http\Services\Backend\Server\Member\UserService;
+use Illuminate\Http\JsonResponse;
+use Illuminate\Http\Request;
+
+class ConfigController extends Controller
+{
+    protected ConfigService $configService;
+
+    public function __construct(ConfigService $configService)
+    {
+        $this->configService = $configService;
+    }
+
+    public function show(): JsonResponse
+    {
+        // 处理显示单个用户的逻辑
+        $result = $this->configService->getConfig();
+        return self::success($result);
+    }
+
+    public function update(Request $request): JsonResponse
+    {
+        // 更新用户逻辑
+        $params = $request->all();
+        $this->configService->updateConfig($params);
+        return self::success(true);
+    }
+}

+ 17 - 7
app/Http/Controllers/Backend/Server/Member/UserController.php

@@ -2,24 +2,34 @@
 
 namespace App\Http\Controllers\Backend\Server\Member;
 
-use App\Http\Controllers\Backend\Server\Controller;
+use App\Http\Controllers\Controller;
 use App\Http\Requests\Backend\Server\System\UserRequest;
-use App\Models\SystemUser;
-use App\Models\User;
+use App\Http\Services\Backend\Server\Member\UserService;
+use Illuminate\Http\JsonResponse;
 use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Hash;
 
 class UserController extends Controller
 {
-    public function index()
+    protected UserService $userService;
+
+    public function __construct(UserService $userService)
+    {
+        $this->userService = $userService;
+    }
+
+    public function index(Request $request): JsonResponse
     {
         // 处理首页逻辑
-        return 'index';
+        $params = $request->all();
+        $result = $this->userService->getUserList($params);
+        return self::success($result);
     }
 
-    public function show($id)
+    public function show(int $id)
     {
         // 处理显示单个用户的逻辑
+        $result = $this->userService->getUser($id);
+        return self::success($result);
     }
 
     public function create()

+ 0 - 2
app/Http/Controllers/Backend/Server/System/UserController.php

@@ -5,10 +5,8 @@ namespace App\Http\Controllers\Backend\Server\System;
 use App\Http\Controllers\Controller;
 use App\Http\Requests\Backend\Server\System\UserRequest;
 use App\Http\Services\Backend\Server\System\UserService;
-use App\Models\System\User;
 use Illuminate\Http\JsonResponse;
 use Illuminate\Http\Request;
-use Illuminate\Support\Facades\Hash;
 
 class UserController extends Controller
 {

+ 29 - 0
app/Http/Services/Backend/Server/Member/ConfigService.php

@@ -0,0 +1,29 @@
+<?php
+/**
+ * @Name
+ * @Description
+ * @Author 刘学玺
+ * @Date 2024/9/4 12:04
+ */
+
+namespace App\Http\Services\Backend\Server\Member;
+
+use App\Http\Services\Service;
+use App\Models\Member\Config;
+
+class ConfigService extends Service
+{
+    protected array $selectColumn = ['id', 'point_trade_deduct_enable as pointTradeDeductEnable', 'point_trade_deduct_unit_price as pointTradeDeductUnitPrice', 'point_trade_deduct_max_price as pointTradeDeductMaxPrice', 'point_trade_give_point as pointTradeGivePoint'];
+    protected array $appendColumn = ['login_date as loginDate', 'created_at as createTime'];
+
+    public function getConfig()
+    {
+        return Config::query()->select($this->selectColumn)->find(1);
+    }
+
+    public function updateConfig(array $data): void
+    {
+        $config = self::toModel($data, Config::class);
+        $config->update($config->getAttributes());
+    }
+}

+ 34 - 0
app/Http/Services/Backend/Server/Member/UserService.php

@@ -0,0 +1,34 @@
+<?php
+/**
+ * @Name
+ * @Description
+ * @Author 刘学玺
+ * @Date 2024/9/4 12:04
+ */
+
+namespace App\Http\Services\Backend\Server\Member;
+
+use App\Models\Member\User;
+
+class UserService
+{
+    protected array $selectColumn = ['id', 'name', 'nickname', 'mark', 'mobile', 'sex', 'avatar', 'point', 'status', 'login_ip as loginIp','register_ip as registerIp'];
+    protected array $appendColumn = ['login_date as loginDate', 'created_at as createTime'];
+
+    public function getUserList($params): array
+    {
+        $user = User::query();
+        isset($params['nickname']) && filled($params['nickname']) && $user->whereLike('nickname', "%{$params['nickname']}%");
+        isset($params['mobile']) && filled($params['mobile']) && $user->whereLike('mobile', "%{$params['mobile']}%");
+//        isset($params['status']) && filled($params['status']) && $user->where('status', $params['status']);
+        !empty($params['loginDate']) && $user->whereBetween('login_date', $params['loginDate']);
+        !empty($params['createTime']) && $user->whereBetween('created_at', $params['createTime']);
+        $rolePage = $user->select([...$this->selectColumn, ...$this->appendColumn])->paginate($params['pageSize'], ['*'], 'page', $params['pageNo']);
+        return ['list' => $rolePage->items(), 'total' => $rolePage->total()];
+    }
+
+    public function getUser($id)
+    {
+        return User::query()->select($this->selectColumn)->find($id);
+    }
+}

+ 35 - 0
app/Models/Member/Config.php

@@ -0,0 +1,35 @@
+<?php
+
+namespace App\Models\Member;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Foundation\Auth\User as Authenticatable;
+use Illuminate\Notifications\Notifiable;
+use Laravel\Sanctum\HasApiTokens;
+use Spatie\Permission\Traits\HasRoles;
+
+class Config extends Model
+{
+    use HasFactory;
+
+    protected $table = 'member_config';
+
+    /**
+     * The attributes that are mass assignable.
+     *
+     * @var array<int, string>
+     */
+    protected $fillable = [];
+
+    protected $guarded = [];
+
+    protected $casts = [
+        'pointTradeDeductEnable' => 'bool'
+    ];
+
+    public function setPointTradeDeductEnableAttribute($value)
+    {
+        $this->attributes['point_trade_deduct_enable'] = $value ? 1 : 0;
+    }
+}

+ 47 - 0
app/Models/Member/User.php

@@ -0,0 +1,47 @@
+<?php
+
+namespace App\Models\Member;
+
+use Illuminate\Database\Eloquent\Factories\HasFactory;
+use Illuminate\Foundation\Auth\User as Authenticatable;
+use Illuminate\Notifications\Notifiable;
+use Laravel\Sanctum\HasApiTokens;
+use Spatie\Permission\Traits\HasRoles;
+
+class User extends Authenticatable
+{
+    use HasApiTokens, HasFactory, Notifiable;
+
+    protected $table = 'member_users';
+
+    /**
+     * The attributes that are mass assignable.
+     *
+     * @var array<int, string>
+     */
+    protected $fillable = [];
+
+    protected $guarded = [];
+
+    /**
+     * The attributes that should be hidden for serialization.
+     *
+     * @var array<int, string>
+     */
+    protected $hidden = [
+        'password'
+    ];
+
+    /**
+     * Get the attributes that should be cast.
+     *
+     * @return array<string, string>
+     */
+    protected function casts(): array
+    {
+        return [
+            'password' => 'hashed',
+            'login_date' => 'datetime'
+        ];
+    }
+}

+ 48 - 0
database/migrations/2024_09_04_022856_create_member_users_table.php

@@ -0,0 +1,48 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration {
+    /**
+     * Run the migrations.
+     */
+    public function up(): void
+    {
+        Schema::create('member_users', function (Blueprint $table) {
+            $table->id();
+            $table->string('mobile')->nullable()->comment('手机号');
+            $table->string('password')->default('')->comment('密码');
+            $table->tinyInteger('status')->default(0)->comment('状态 (0正常 1停用)');
+            $table->string('register_ip')->comment('注册IP');
+            $table->tinyInteger('register_terminal')->nullable()->comment('注册终端');
+            $table->string('login_ip', 50)->nullable()->comment('最后登录IP');
+            $table->timestamp('login_date')->nullable()->comment('最后登录时间');
+            $table->string('nickname')->nullable()->comment('用户昵称');
+            $table->string('avatar')->nullable()->comment('用户头像');
+            $table->string('name')->nullable()->comment('用户姓名');
+            $table->tinyInteger('sex')->default(0)->nullable()->comment('用户性别');
+            $table->bigInteger('area_id')->nullable()->comment('所在地');
+            $table->timestamp('birthday')->nullable()->comment('出生日期');
+            $table->string('mark')->nullable()->comment('会员备注');
+            $table->integer('point')->default(0)->comment('用户积分');
+            $table->string('tag_ids')->nullable()->comment('用户标签编号列表,以逗号分隔');
+            $table->bigInteger('level_id')->nullable()->comment('等级编号');
+            $table->integer('experience')->default(0)->comment('用户经验');
+            $table->bigInteger('group_id')->nullable()->comment('用户分组');
+            $table->string('creator', 64)->nullable()->comment('创建者');
+            $table->string('updater', 64)->nullable()->comment('更新者');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     */
+    public function down(): void
+    {
+        Schema::dropIfExists('member_users');
+    }
+};

+ 33 - 0
database/migrations/2024_09_04_065901_create_member_config_table.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration {
+    /**
+     * Run the migrations.
+     */
+    public function up(): void
+    {
+        Schema::create('member_config', function (Blueprint $table) {
+            $table->id();
+            $table->tinyInteger('point_trade_deduct_enable')->comment('是否开启积分抵扣');
+            $table->integer('point_trade_deduct_unit_price')->comment('积分抵扣(单位:分)');
+            $table->integer('point_trade_deduct_max_price')->nullable()->comment('积分抵扣最大值');
+            $table->bigInteger('point_trade_give_point')->nullable()->comment('1 元赠送多少分');
+            $table->string('creator', 64)->nullable()->comment('创建者');
+            $table->string('updater', 64)->nullable()->comment('更新者');
+            $table->timestamps();
+            $table->softDeletes();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     */
+    public function down(): void
+    {
+        Schema::dropIfExists('member_config');
+    }
+};

+ 4 - 1
database/seeders/DatabaseSeeder.php

@@ -20,7 +20,10 @@ class DatabaseSeeder extends Seeder
             SystemMenusTableSeeder::class,
             SystemModelHasRolesTableSeeder::class,
             SystemPermissionsTableSeeder::class,
-            SystemRoleHasPermissionsTableSeeder::class
+            SystemRoleHasPermissionsTableSeeder::class,
+
+            MemberUsersTableSeeder::class,
+            MemberConfigTableSeeder::class
             // 其他Seeder类...
         ]);
     }

+ 21 - 0
database/seeders/MemberConfigTableSeeder.php

@@ -0,0 +1,21 @@
+<?php
+
+namespace Database\Seeders;
+
+use App\Models\System\User;
+use Illuminate\Database\Console\Seeds\WithoutModelEvents;
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Hash;
+
+class MemberConfigTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     */
+    public function run(): void
+    {
+        //
+        DB::table('member_config')->insert(['point_trade_deduct_enable' => 1, 'point_trade_deduct_unit_price' => 100, 'point_trade_deduct_max_price' => 2, 'point_trade_give_point' => 3, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+    }
+}

+ 22 - 0
database/seeders/MemberUsersTableSeeder.php

@@ -0,0 +1,22 @@
+<?php
+
+namespace Database\Seeders;
+
+use App\Models\System\User;
+use Illuminate\Database\Console\Seeds\WithoutModelEvents;
+use Illuminate\Database\Seeder;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Hash;
+
+class MemberUsersTableSeeder extends Seeder
+{
+    /**
+     * Run the database seeds.
+     */
+    public function run(): void
+    {
+        //
+        DB::table('member_users')->insert(['id' => 1, 'nickname' => '醉梦人间三千年', 'avatar' => 'https://thirdwx.qlogo.cn/mmopen/vi_32/lBOz003W9viby0pMU5p5RU2QpcLOHogciaPuVTCZSp82mhqQ1VbWGghHibJMgib2BiblibY9vVAHqIGlnpMY2gLoyCEaibQoJKiblOKUdjxC0ebeToY/132','register_ip' => '127.0.0.1', 'created_at' => now(), 'updated_at' => now()]);
+//        DB::table('system_users')->insert(['id' => 2, 'username' => 'admin', 'password' => Hash::make('admin'), 'created_at' => now(), 'updated_at' => now()]);
+    }
+}

+ 31 - 5
database/seeders/SystemMenusTableSeeder.php

@@ -15,18 +15,33 @@ class SystemMenusTableSeeder extends Seeder
     public function run(): void
     {
         // 目录
-        DB::table('system_menus')->insert(['id' => 1, 'name' => '系统菜单', 'type' => 1, 'path' => '/system', 'icon' => 'ep:tools', 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 1, 'name' => '系统管理', 'type' => 1, 'path' => '/system', 'icon' => 'ep:tools', 'sort' => 99, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 2, 'name' => '会员中心', 'type' => 1, 'path' => '/member', 'icon' => 'ep:bicycle', 'sort' => 10, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 3, 'name' => '技工中心', 'type' => 1, 'path' => '/techer', 'icon' => 'fa:automobile', 'sort' => 11, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 4, 'name' => '服务中心', 'type' => 1, 'path' => '/service', 'icon' => 'fa:american-sign-language-interpreting', 'sort' => 12, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
 
         // 菜单
+        // 系统管理
         DB::table('system_menus')->insert(['id' => 100, 'name' => '用户管理', 'type' => 2, 'parent_id' => 1, 'path' => 'user', 'icon' => 'ep:avatar', 'component' => 'system/user/index', 'component_name' => 'SystemUser', 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 110, 'name' => '角色管理', 'type' => 2, 'parent_id' => 1, 'path' => 'role', 'icon' => 'ep:user', 'component' => 'system/role/index', 'component_name' => 'SystemRole', 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 120, 'name' => '菜单管理', 'type' => 2, 'parent_id' => 1, 'path' => 'menu', 'icon' => 'ep:menu', 'component' => 'system/menu/index', 'component_name' => 'SystemMenu', 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 130, 'name' => '部门管理', 'type' => 2, 'parent_id' => 1, 'path' => 'menu', 'icon' => 'ep:menu', 'component' => 'system/menu/index', 'component_name' => 'SystemMenu', 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 140, 'name' => '岗位管理', 'type' => 2, 'parent_id' => 1, 'path' => 'menu', 'icon' => 'ep:menu', 'component' => 'system/menu/index', 'component_name' => 'SystemMenu', 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 150, 'name' => '字典管理', 'type' => 2, 'parent_id' => 1, 'path' => 'dict', 'icon' => 'ep:collection', 'component' => 'system/dict/index', 'component_name' => 'SystemDictType', 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        // 会员中心
+        DB::table('system_menus')->insert(['id' => 200, 'name' => '会员管理', 'type' => 2, 'parent_id' => 2, 'path' => 'user', 'icon' => 'ep:avatar', 'component' => 'member/user/index', 'component_name' => 'MemberUser', 'sort' => 0, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 210, 'name' => '会员配置', 'type' => 2, 'parent_id' => 2, 'path' => 'config', 'icon' => 'fa:archive', 'component' => 'member/config/index', 'component_name' => 'MemberConfig', 'sort' => 10, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        // 技工中心
+        DB::table('system_menus')->insert(['id' => 300, 'name' => '技工管理', 'type' => 2, 'parent_id' => 3, 'path' => 'user', 'icon' => 'ep:avatar', 'component' => 'member/user/index', 'component_name' => 'MemberUser', 'sort' => 0, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 310, 'name' => '技工配置', 'type' => 2, 'parent_id' => 3, 'path' => 'config', 'icon' => 'ep:setting', 'component' => 'member/config/index', 'component_name' => 'MemberConfig', 'sort' => 10, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        // 服务中心
+        DB::table('system_menus')->insert(['id' => 400, 'name' => '服务管理', 'type' => 2, 'parent_id' => 4, 'path' => 'config', 'icon' => 'ep:bell-filled', 'component' => 'member/config/index', 'component_name' => 'MemberConfig', 'sort' => 0, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 410, 'name' => '服务分类', 'type' => 2, 'parent_id' => 4, 'path' => 'config', 'icon' => 'ep:bell-filled', 'component' => 'member/config/index', 'component_name' => 'MemberConfig', 'sort' => 1, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 420, 'name' => '服务审核', 'type' => 2, 'parent_id' => 4, 'path' => 'config', 'icon' => 'fa:500px', 'component' => 'member/config/index', 'component_name' => 'MemberConfig', 'sort' => 2, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 490, 'name' => '服务配置', 'type' => 2, 'parent_id' => 4, 'path' => 'config', 'icon' => 'fa:archive', 'component' => 'member/config/index', 'component_name' => 'MemberConfig', 'sort' => 9, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
 
         // 按钮
-        // 用户管理
+        // 系统管理 - 用户管理
         DB::table('system_menus')->insert(['id' => 101, 'name' => '用户查询', 'type' => 3, 'permission' => 'system:user:query', 'parent_id' => 100, 'sort' => 1, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 102, 'name' => '用户新增', 'type' => 3, 'permission' => 'system:user:create', 'parent_id' => 100, 'sort' => 2, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 103, 'name' => '用户修改', 'type' => 3, 'permission' => 'system:user:update', 'parent_id' => 100, 'sort' => 3, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
@@ -35,7 +50,7 @@ class SystemMenusTableSeeder extends Seeder
         DB::table('system_menus')->insert(['id' => 106, 'name' => '用户导入', 'type' => 3, 'permission' => 'system:user:import', 'parent_id' => 100, 'sort' => 6, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 107, 'name' => '重置密码', 'type' => 3, 'permission' => 'system:user:update-password', 'parent_id' => 100, 'sort' => 7, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
 
-        // 角色管理
+        // 系统管理 - 角色管理
         DB::table('system_menus')->insert(['id' => 111, 'name' => '角色查询', 'type' => 3, 'permission' => 'system:role:query', 'parent_id' => 110, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 112, 'name' => '角色新增', 'type' => 3, 'permission' => 'system:role:create', 'parent_id' => 110, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 113, 'name' => '角色修改', 'type' => 3, 'permission' => 'system:role:update', 'parent_id' => 110, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
@@ -45,18 +60,29 @@ class SystemMenusTableSeeder extends Seeder
         DB::table('system_menus')->insert(['id' => 117, 'name' => '设置角色数据权限', 'type' => 3, 'permission' => 'system:permission:assign-role-data-scope', 'parent_id' => 110, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 118, 'name' => '设置用户角色', 'type' => 3, 'permission' => 'system:permission:assign-user-role', 'parent_id' => 110, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
 
-        // 菜单管理
+        // 系统管理 - 菜单管理
         DB::table('system_menus')->insert(['id' => 121, 'name' => '菜单查询', 'type' => 3, 'permission' => 'system:menu:query', 'parent_id' => 120, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 122, 'name' => '菜单新增', 'type' => 3, 'permission' => 'system:menu:create', 'parent_id' => 120, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 123, 'name' => '菜单修改', 'type' => 3, 'permission' => 'system:menu:update', 'parent_id' => 120, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 124, 'name' => '菜单删除', 'type' => 3, 'permission' => 'system:menu:delete', 'parent_id' => 120, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
-        // 字典管理
+        // 系统管理 - 字典管理
         DB::table('system_menus')->insert(['id' => 151, 'name' => '字典查询', 'type' => 3, 'permission' => 'system:dict:query', 'parent_id' => 150, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 152, 'name' => '字典新增', 'type' => 3, 'permission' => 'system:dict:create', 'parent_id' => 150, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 153, 'name' => '字典修改', 'type' => 3, 'permission' => 'system:dict:update', 'parent_id' => 150, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 154, 'name' => '字典删除', 'type' => 3, 'permission' => 'system:dict:delete', 'parent_id' => 150, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
         DB::table('system_menus')->insert(['id' => 155, 'name' => '字典导出', 'type' => 3, 'permission' => 'system:dict:export', 'parent_id' => 150, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
 
+        // 会员中心 - 会员管理
+        DB::table('system_menus')->insert(['id' => 201, 'name' => '会员用户查询', 'type' => 3, 'permission' => 'member:user:query', 'parent_id' => 200, 'sort' => 1, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 202, 'name' => '会员用户更新', 'type' => 3, 'permission' => 'member:user:update', 'parent_id' => 200, 'sort' => 3, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 203, 'name' => '用户等级修改', 'type' => 3, 'permission' => 'member:user:update-level', 'parent_id' => 200, 'sort' => 5, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 204, 'name' => '用户积分修改', 'type' => 3, 'permission' => 'member:user:update-point', 'parent_id' => 200, 'sort' => 6, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 205, 'name' => '用户余额修改', 'type' => 3, 'permission' => 'member:user:update-balance', 'parent_id' => 200, 'sort' => 7, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        // 会员中心 - 会员配置
+        DB::table('system_menus')->insert(['id' => 211, 'name' => '会员配置查询', 'type' => 3, 'permission' => 'member:config:query', 'parent_id' => 210, 'sort' => 1, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+        DB::table('system_menus')->insert(['id' => 212, 'name' => '会员配置保存', 'type' => 3, 'permission' => 'member:config:save', 'parent_id' => 210, 'sort' => 1, 'creator' => '系统', 'created_at' => now(), 'updated_at' => now()]);
+
+        // 技师中心 - 技师管理
 
     }
 }

+ 12 - 0
database/seeders/SystemPermissionsTableSeeder.php

@@ -68,5 +68,17 @@ class SystemPermissionsTableSeeder extends Seeder
         DB::table($tableNames['model_has_permissions'])->insert(['permission_id' => 154, 'model_type' => Menu::class, 'model_id' => 154]);
         DB::table($tableNames['model_has_permissions'])->insert(['permission_id' => 155, 'model_type' => Menu::class, 'model_id' => 155]);
 
+        // 会员中心
+        // 会员管理
+        DB::table($tableNames['permissions'])->insert(['id' => 201, 'name' => 'member:user:query']);
+        DB::table($tableNames['permissions'])->insert(['id' => 202, 'name' => 'member:user:update']);
+        DB::table($tableNames['permissions'])->insert(['id' => 203, 'name' => 'member:user:update-level']);
+        DB::table($tableNames['permissions'])->insert(['id' => 204, 'name' => 'member:user:update-point']);
+        DB::table($tableNames['permissions'])->insert(['id' => 205, 'name' => 'member:user:update-balance']);
+
+        // 会员配置
+        DB::table($tableNames['permissions'])->insert(['id' => 211, 'name' => 'member:config:query']);
+        DB::table($tableNames['permissions'])->insert(['id' => 212, 'name' => 'member:config:save']);
+
     }
 }

+ 12 - 0
routes/web.php

@@ -11,6 +11,8 @@ use App\Http\Controllers\Backend\Server\System\PermissionController;
 use App\Http\Controllers\Backend\Server\System\PostController;
 use App\Http\Controllers\Backend\Server\System\RoleController;
 use App\Http\Controllers\Backend\Server\System\UserController;
+use App\Http\Controllers\Backend\Server\Member\UserController as MemberUserController;
+use App\Http\Controllers\Backend\Server\Member\ConfigController as MemberConfigController;
 use Illuminate\Support\Facades\Route;
 
 Route::get('/', function () {
@@ -30,6 +32,16 @@ Route::prefix('client')->group(function () {
 //        ->middleware('guest')
 //        ->name('register');
 
+# 会员中心
+Route::prefix('member')->group(function () {
+    # 会员管理
+    Route::resource('user', MemberUserController::class);
+    # 会员配置
+    Route::get('config/get', [MemberConfigController::class, 'show']);
+    Route::put('config/save', [MemberConfigController::class, 'update']);
+
+});
+
 Route::prefix('system')->group(function () {
     Route::post('auth/login', [AuthController::class, 'login']);
     Route::get('auth/get-permission-info', [AuthController::class, 'getPermissionInfo']);