diff --git a/app/Http/Controllers/Admin/SupportTicketController.php b/app/Http/Controllers/Admin/SupportTicketController.php new file mode 100644 index 0000000..e1be393 --- /dev/null +++ b/app/Http/Controllers/Admin/SupportTicketController.php @@ -0,0 +1,21 @@ +ensurePlatformAdmin($request); + + // 当前阶段:先做最小骨架页,后续再接入列表/筛选/创建/指派/SLA/升级。 + return view('admin.support_tickets.index'); + } +} diff --git a/app/Models/SupportTicket.php b/app/Models/SupportTicket.php new file mode 100644 index 0000000..cea587b --- /dev/null +++ b/app/Models/SupportTicket.php @@ -0,0 +1,31 @@ + 'datetime', + ]; +} diff --git a/database/migrations/2026_03_15_083356_create_support_tickets_table.php b/database/migrations/2026_03_15_083356_create_support_tickets_table.php new file mode 100644 index 0000000..3403600 --- /dev/null +++ b/database/migrations/2026_03_15_083356_create_support_tickets_table.php @@ -0,0 +1,59 @@ +id(); + + // scope:用于多层级隔离(platform/site/merchant) + $table->string('scope', 20)->default('platform'); + $table->unsignedBigInteger('scope_id')->nullable(); + + // 关联对象(用于“收费闭环/治理串联”) + $table->unsignedBigInteger('merchant_id')->nullable(); + $table->unsignedBigInteger('buyer_id')->nullable(); + $table->unsignedBigInteger('order_id')->nullable(); + $table->unsignedBigInteger('platform_order_id')->nullable(); + $table->unsignedBigInteger('site_subscription_id')->nullable(); + $table->unsignedBigInteger('platform_lead_id')->nullable(); + + // 工单基础字段 + $table->string('ticket_no', 50)->unique(); + $table->string('category', 50)->default('general'); + $table->string('priority', 20)->default('normal'); + $table->string('status', 20)->default('open'); + $table->string('subject', 200)->default(''); + $table->text('content')->nullable(); + + // 指派与时间 + $table->unsignedBigInteger('assigned_admin_id')->nullable(); + $table->timestamp('closed_at')->nullable(); + + $table->timestamps(); + + $table->index(['scope', 'scope_id']); + $table->index(['merchant_id']); + $table->index(['platform_order_id']); + $table->index(['site_subscription_id']); + $table->index(['platform_lead_id']); + $table->index(['status', 'priority']); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('support_tickets'); + } +}; diff --git a/resources/views/admin/layouts/app.blade.php b/resources/views/admin/layouts/app.blade.php index 666d9c7..8aa117c 100644 --- a/resources/views/admin/layouts/app.blade.php +++ b/resources/views/admin/layouts/app.blade.php @@ -43,6 +43,13 @@ + +