feat(admin): platform orders list link to subscription show

This commit is contained in:
萝卜
2026-03-10 12:23:37 +00:00
parent cff6677f6d
commit 0db14263fe
2 changed files with 47 additions and 1 deletions

View File

@@ -174,6 +174,46 @@ class AdminPlatformOrderTest extends TestCase
->assertSee('模拟失败')
->assertSee('余额不足');
// 订阅号列应可点击进入订阅详情(提升治理联动效率)
$sub = \App\Models\SiteSubscription::query()->create([
'merchant_id' => $merchant->id,
'plan_id' => $plan->id,
'status' => 'activated',
'source' => 'manual',
'subscription_no' => 'SUB_LINK_0001',
'plan_name' => $plan->name,
'billing_cycle' => $plan->billing_cycle,
'period_months' => 1,
'amount' => 10,
'starts_at' => now()->subDay(),
'ends_at' => now()->addMonth(),
'activated_at' => now()->subDay(),
]);
PlatformOrder::query()->create([
'merchant_id' => $merchant->id,
'plan_id' => $plan->id,
'site_subscription_id' => $sub->id,
'order_no' => 'PO_SUB_LINK_0001',
'order_type' => 'renewal',
'status' => 'activated',
'payment_status' => 'paid',
'plan_name' => '专业版(月付)',
'billing_cycle' => 'monthly',
'period_months' => 1,
'quantity' => 1,
'payable_amount' => 199,
'paid_amount' => 199,
'placed_at' => now()->subMinutes(2),
'paid_at' => now()->subMinutes(1),
'activated_at' => now(),
]);
$this->get('/admin/platform-orders?keyword=PO_SUB_LINK_0001')
->assertOk()
->assertSee('SUB_LINK_0001')
->assertSee('/admin/site-subscriptions/' . $sub->id);
// 只看已同步:构造一条带有 subscription_activation 的订单 + 批量同步审计(用于列表展示)
PlatformOrder::query()->where('order_no', 'PO202603100101')->update([
'meta' => [