From 62d7a81df32891dfe366630eab92d07cb8a5d9bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sun, 15 Mar 2026 08:44:02 +0000 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E5=AE=A2=E6=9C=8D=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E5=B7=A5=E5=8D=95=E9=AA=A8=E6=9E=B6=EF=BC=88=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B/=E8=BF=81=E7=A7=BB/=E8=B7=AF=E7=94=B1/=E8=8F=9C?= =?UTF-8?q?=E5=8D=95/=E9=A1=B5=E9=9D=A2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/SupportTicketController.php | 21 +++++++ app/Models/SupportTicket.php | 31 ++++++++++ ...15_083356_create_support_tickets_table.php | 59 +++++++++++++++++++ resources/views/admin/layouts/app.blade.php | 7 +++ .../admin/support_tickets/index.blade.php | 16 +++++ routes/web.php | 4 ++ ...SupportTicketIndexPageShouldRenderTest.php | 32 ++++++++++ ...pNavShouldContainSupportCenterLinkTest.php | 33 +++++++++++ 8 files changed, 203 insertions(+) create mode 100644 app/Http/Controllers/Admin/SupportTicketController.php create mode 100644 app/Models/SupportTicket.php create mode 100644 database/migrations/2026_03_15_083356_create_support_tickets_table.php create mode 100644 resources/views/admin/support_tickets/index.blade.php create mode 100644 tests/Feature/AdminSupportTicketIndexPageShouldRenderTest.php create mode 100644 tests/Feature/AdminTopNavShouldContainSupportCenterLinkTest.php 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 @@ + +