feat(admin): 平台订单筛选增加线索ID(lead_id)与上下文提示
This commit is contained in:
@@ -40,7 +40,16 @@
|
|||||||
|
|
||||||
@php
|
@php
|
||||||
$currentSubscription = $currentSubscription ?? null;
|
$currentSubscription = $currentSubscription ?? null;
|
||||||
|
$incomingLeadId = (int) request()->query('lead_id', 0);
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
|
@if($incomingLeadId > 0)
|
||||||
|
<div class="mt-10">
|
||||||
|
<span class="badge">当前线索:#{{ $incomingLeadId }}</span>
|
||||||
|
<span class="muted muted-xs">(已按 lead_id 过滤订单集合)</span>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if($currentSubscription && $currentSubscription->id)
|
@if($currentSubscription && $currentSubscription->id)
|
||||||
<div class="mt-10">
|
<div class="mt-10">
|
||||||
<div class="muted">当前已锁定订阅:</div>
|
<div class="muted">当前已锁定订阅:</div>
|
||||||
@@ -247,6 +256,7 @@
|
|||||||
<span>只看退款不一致(状态 vs 退款总额)</span>
|
<span>只看退款不一致(状态 vs 退款总额)</span>
|
||||||
</label>
|
</label>
|
||||||
<input type="text" name="keyword" placeholder="关键词:订单号/站点/订阅号" value="{{ $filters['keyword'] ?? '' }}">
|
<input type="text" name="keyword" placeholder="关键词:订单号/站点/订阅号" value="{{ $filters['keyword'] ?? '' }}">
|
||||||
|
<input type="number" name="lead_id" placeholder="线索ID(可选)" value="{{ $filters['lead_id'] ?? '' }}" class="w-140">
|
||||||
<input type="text" name="sync_error_keyword" placeholder="同步失败原因关键词(可选)" value="{{ $filters['sync_error_keyword'] ?? '' }}">
|
<input type="text" name="sync_error_keyword" placeholder="同步失败原因关键词(可选)" value="{{ $filters['sync_error_keyword'] ?? '' }}">
|
||||||
<input type="text" name="bmpa_error_keyword" placeholder="批量标记支付并生效失败原因关键词(可选)" value="{{ $filters['bmpa_error_keyword'] ?? '' }}">
|
<input type="text" name="bmpa_error_keyword" placeholder="批量标记支付并生效失败原因关键词(可选)" value="{{ $filters['bmpa_error_keyword'] ?? '' }}">
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Tests\Feature;
|
||||||
|
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
use Tests\TestCase;
|
||||||
|
|
||||||
|
class AdminPlatformOrderIndexLeadIdFilterFormFieldTest extends TestCase
|
||||||
|
{
|
||||||
|
use RefreshDatabase;
|
||||||
|
|
||||||
|
protected function loginAsPlatformAdmin(): void
|
||||||
|
{
|
||||||
|
$this->seed();
|
||||||
|
|
||||||
|
$this->post('/admin/login', [
|
||||||
|
'email' => 'platform.admin@demo.local',
|
||||||
|
'password' => 'Platform@123456',
|
||||||
|
])->assertRedirect('/admin');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_index_should_render_lead_id_filter_field(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$res = $this->get('/admin/platform-orders');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$res->assertSee('name="lead_id"', false);
|
||||||
|
$res->assertSee('线索ID', false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function test_index_should_render_lead_context_badge_when_filtered(): void
|
||||||
|
{
|
||||||
|
$this->loginAsPlatformAdmin();
|
||||||
|
|
||||||
|
$res = $this->get('/admin/platform-orders?lead_id=12');
|
||||||
|
$res->assertOk();
|
||||||
|
|
||||||
|
$res->assertSee('当前线索:#12', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user