From eef0fbad8ae4e338596ada3f8f46d2205209c5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 17 Mar 2026 14:20:43 +0800 Subject: [PATCH] ui(platform-orders): add bmpa run_id badge with quick links --- .../admin/platform_orders/index.blade.php | 34 +++++++++++++++++ ...dexBatchBmpaRunIdBadgeShouldRenderTest.php | 38 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 tests/Feature/AdminPlatformOrderIndexBatchBmpaRunIdBadgeShouldRenderTest.php diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index 610bfad..cc02ae0 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -542,6 +542,40 @@ @endif +@php + $batchBmpaRunId = trim((string) ($filters['batch_bmpa_run_id'] ?? '')); +@endphp +@if($batchBmpaRunId !== '') + @php + $bmpaGoFailedUrl = $buildQuickFilterUrl([ + 'batch_bmpa_run_id' => $batchBmpaRunId, + 'bmpa_failed_only' => '1', + 'page' => null, + ]); + + $bmpaGoAllUrl = $buildQuickFilterUrl([ + 'batch_bmpa_run_id' => $batchBmpaRunId, + 'page' => null, + ]); + @endphp +
+
当前 BMPA 批次筛选
+
+
+ 当前 BMPA run_id:{{ $batchBmpaRunId }} + + 清除 BMPA 批次筛选 +
+
+ 快速查看: + 本批次全部 + + 本批次 BMPA 失败 +
+
+
+@endif +

平台订单总数

diff --git a/tests/Feature/AdminPlatformOrderIndexBatchBmpaRunIdBadgeShouldRenderTest.php b/tests/Feature/AdminPlatformOrderIndexBatchBmpaRunIdBadgeShouldRenderTest.php new file mode 100644 index 0000000..f41f2e8 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexBatchBmpaRunIdBadgeShouldRenderTest.php @@ -0,0 +1,38 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_platform_orders_page_should_render_batch_bmpa_run_id_badge_and_quick_links(): void + { + $this->loginAsPlatformAdmin(); + + $runId = 'BMPA_TEST_BADGE_0001'; + + $html = $this->get('/admin/platform-orders?batch_bmpa_run_id=' . $runId) + ->assertOk() + ->getContent(); + + $this->assertStringContainsString('当前 BMPA run_id:' . $runId . '', $html); + + // 快捷入口:本批次失败(应带 batch_bmpa_run_id + bmpa_failed_only=1) + $this->assertStringContainsString('batch_bmpa_run_id=' . $runId, $html); + $this->assertStringContainsString('bmpa_failed_only=1', $html); + } +}