fix(admin): 仪表盘待生效计数排除同步失败(口径更清晰)
This commit is contained in:
@@ -55,6 +55,8 @@ class DashboardController extends Controller
|
|||||||
'platform_orders_paid_pending' => PlatformOrder::query()
|
'platform_orders_paid_pending' => PlatformOrder::query()
|
||||||
->where('payment_status', 'paid')
|
->where('payment_status', 'paid')
|
||||||
->where('status', 'pending')
|
->where('status', 'pending')
|
||||||
|
// 口径对齐“待生效”语义:排除明确的同步失败(失败单应该去同步失败治理)
|
||||||
|
->whereRaw("JSON_EXTRACT(meta, '$.subscription_activation_error.message') IS NULL")
|
||||||
->count(),
|
->count(),
|
||||||
// 同步失败:沿用平台订单列表口径(meta.subscription_activation_error.message 存在即失败)
|
// 同步失败:沿用平台订单列表口径(meta.subscription_activation_error.message 存在即失败)
|
||||||
'platform_orders_sync_failed' => PlatformOrder::query()
|
'platform_orders_sync_failed' => PlatformOrder::query()
|
||||||
|
|||||||
@@ -86,9 +86,9 @@ class AdminDashboardBillingWorkbenchQuickLinksShouldShowCountsTest extends TestC
|
|||||||
$res = $this->get('/admin');
|
$res = $this->get('/admin');
|
||||||
$res->assertOk();
|
$res->assertOk();
|
||||||
|
|
||||||
// paid_pending 的定义是 paid + pending,其中包含 sync_failed 那一条,因此预期为 2
|
// 待生效口径:paid + pending,但排除“同步失败”(失败应在同步失败集合处理)
|
||||||
$res->assertSee('待支付(1)');
|
$res->assertSee('待支付(1)');
|
||||||
$res->assertSee('待生效(2)');
|
$res->assertSee('待生效(1)');
|
||||||
$res->assertSee('同步失败(1)');
|
$res->assertSee('同步失败(1)');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user