From 5ee305228068c6c6ea26b22fed6c85172e82d9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Wed, 18 Mar 2026 03:41:51 +0800 Subject: [PATCH] feat(platform-orders): show bmpa success/failed summary and add bmpa_success_orders stat --- app/Http/Controllers/Admin/PlatformOrderController.php | 4 ++++ resources/views/admin/platform_orders/index.blade.php | 6 ++++-- .../Feature/AdminPlatformOrderBmpaFailedSummaryCardTest.php | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index 1e28f09..39938db 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -436,6 +436,10 @@ class PlatformOrderController extends Controller 'bmpa_failed_orders' => (clone $baseQuery) ->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate_error.message') IS NOT NULL") ->count(), + 'bmpa_success_orders' => (clone $baseQuery) + ->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate.run_id') IS NOT NULL") + ->whereRaw("JSON_EXTRACT(meta, '$.batch_mark_paid_and_activate_error.message') IS NULL") + ->count(), 'unsynced_orders' => (clone $baseQuery) ->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation.subscription_id') IS NULL") ->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NULL") diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index ad16639..7148e8c 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -637,11 +637,13 @@
-

BMPA 失败数

+

BMPA 成功 / 失败

-
批量标记支付并生效失败(meta 失败标记)
+
成功口径:存在 run_id 且无 error.message;失败口径:meta 失败标记

可同步订单

diff --git a/tests/Feature/AdminPlatformOrderBmpaFailedSummaryCardTest.php b/tests/Feature/AdminPlatformOrderBmpaFailedSummaryCardTest.php index f194368..0b939fb 100644 --- a/tests/Feature/AdminPlatformOrderBmpaFailedSummaryCardTest.php +++ b/tests/Feature/AdminPlatformOrderBmpaFailedSummaryCardTest.php @@ -64,7 +64,8 @@ class AdminPlatformOrderBmpaFailedSummaryCardTest extends TestCase $res = $this->get('/admin/platform-orders'); $res->assertOk(); - $res->assertSee('BMPA 失败数'); + $res->assertSee('BMPA 成功 / 失败'); $res->assertSee('/admin/platform-orders?bmpa_failed_only=1', false); + $res->assertSee('/admin/platform-orders?bmpa_success_only=1', false); } }