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 成功 / 失败

+ {{ $summaryStats['bmpa_success_orders'] ?? 0 }} + / {{ $summaryStats['bmpa_failed_orders'] ?? 0 }}
-
批量标记支付并生效失败(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); } }