From f24a50f1379fdd0a1889ad1b1dc8b9c5ef347325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sat, 14 Mar 2026 02:52:26 +0000 Subject: [PATCH] =?UTF-8?q?feat(admin):=20=E5=BC=80=E9=80=9A=E7=BA=BF?= =?UTF-8?q?=E7=B4=A2=20PlatformLead=20=E6=80=BB=E5=8F=B0=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=EF=BC=88=E5=8F=AA=E8=AF=BB=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/PlatformLeadController.php | 52 ++++++++++++++ .../admin/platform_leads/index.blade.php | 71 +++++++++++++++++++ routes/web.php | 2 + 3 files changed, 125 insertions(+) create mode 100644 app/Http/Controllers/Admin/PlatformLeadController.php create mode 100644 resources/views/admin/platform_leads/index.blade.php diff --git a/app/Http/Controllers/Admin/PlatformLeadController.php b/app/Http/Controllers/Admin/PlatformLeadController.php new file mode 100644 index 0000000..02a3fbe --- /dev/null +++ b/app/Http/Controllers/Admin/PlatformLeadController.php @@ -0,0 +1,52 @@ +ensurePlatformAdmin($request); + + $filters = [ + 'status' => trim((string) $request->query('status', '')), + 'keyword' => trim((string) $request->query('keyword', '')), + ]; + + $query = PlatformLead::query(); + + $query->when($filters['status'] !== '', fn (Builder $b) => $b->where('status', $filters['status'])); + $query->when($filters['keyword'] !== '', function (Builder $b) use ($filters) { + $kw = $filters['keyword']; + $b->where(function (Builder $q) use ($kw) { + $q->where('name', 'like', '%' . $kw . '%') + ->orWhere('mobile', 'like', '%' . $kw . '%') + ->orWhere('email', 'like', '%' . $kw . '%') + ->orWhere('company', 'like', '%' . $kw . '%'); + }); + }); + + $leads = $query->latest('id')->paginate(15)->withQueryString(); + + return view('admin.platform_leads.index', [ + 'leads' => $leads, + 'filters' => $filters, + 'statusLabels' => [ + 'new' => '新线索', + 'contacted' => '已联系', + 'qualified' => '已确认需求', + 'converted' => '已转化', + 'closed' => '已关闭', + ], + ]); + } +} diff --git a/resources/views/admin/platform_leads/index.blade.php b/resources/views/admin/platform_leads/index.blade.php new file mode 100644 index 0000000..d7ea358 --- /dev/null +++ b/resources/views/admin/platform_leads/index.blade.php @@ -0,0 +1,71 @@ +@extends('admin.layouts.app') + +@section('title', '开通线索') +@section('page_title', '开通线索') + +@section('content') +
+

对外平台(/platform)收集的开通意向线索,用于前期 A(站点开通型)人工运营承接。

+

后续会在此处逐步接入:一键生成站点/订阅/平台订单、跟进记录、转化漏斗与治理提示。

+
+ +
+

筛选

+
+ + +
+ +
+
+
+ +
+

线索列表

+
当前阶段仅提供查询与筛选;后续补“状态流转/转化为站点/生成订单”等操作闭环。
+ + + + + + + + + + + + + + + + + @forelse($leads as $l) + + + + + + + + + + + + @empty + + + + @endforelse + +
ID状态姓名手机号邮箱公司套餐ID来源创建时间
{{ $l->id }}{{ $statusLabels[$l->status] ?? $l->status }}{{ $l->name }}{{ $l->mobile }}{{ $l->email }}{{ $l->company }}{{ $l->plan_id ?: '-' }}{{ $l->source }}{{ optional($l->created_at)->format('Y-m-d H:i:s') }}
暂无线索
+ +
+ {{ $leads->links() }} +
+
+@endsection diff --git a/routes/web.php b/routes/web.php index bda2366..2a7791c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -148,6 +148,8 @@ Route::prefix('admin')->group(function () { Route::get('/settings/channels', [PlatformSettingController::class, 'channels']); Route::post('/settings/channels/{id}', [PlatformSettingController::class, 'updateChannel']); Route::post('/settings/payments/{id}', [PlatformSettingController::class, 'updatePayment']); + + Route::get('/platform-leads', [\App\Http\Controllers\Admin\PlatformLeadController::class, 'index']); }); });