feat(admin): 客服中心工单骨架(模型/迁移/路由/菜单/页面)

This commit is contained in:
萝卜
2026-03-15 08:44:02 +00:00
parent 0bd21f8715
commit 62d7a81df3
8 changed files with 203 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
<?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('support_tickets', function (Blueprint $table) {
$table->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');
}
};