feat(admin): order show link to subscription show

This commit is contained in:
萝卜
2026-03-10 12:17:25 +00:00
parent e80e0d1182
commit f987f7b907
2 changed files with 22 additions and 1 deletions

View File

@@ -74,6 +74,25 @@ class AdminPlatformOrderShowTest extends TestCase
],
]);
// 关联一个订阅,确保详情页出现“打开订阅详情”入口
$sub = \App\Models\SiteSubscription::query()->create([
'merchant_id' => $merchant->id,
'plan_id' => $plan->id,
'status' => 'activated',
'source' => 'manual',
'subscription_no' => 'SUB_SHOW_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(),
]);
$order->site_subscription_id = $sub->id;
$order->save();
$this->get('/admin/platform-orders/' . $order->id)
->assertOk()
->assertSee('平台订单详情')
@@ -81,6 +100,8 @@ class AdminPlatformOrderShowTest extends TestCase
->assertSee('标记支付并生效')
->assertSee('同步订阅')
->assertSee('订阅同步元数据')
->assertSee('关联订阅')
->assertSee('打开订阅详情')
->assertSee('审计记录')
->assertSee('清除同步失败标记');
}