diff --git a/resources/views/admin/platform_orders/show.blade.php b/resources/views/admin/platform_orders/show.blade.php index 679d930..495050b 100644 --- a/resources/views/admin/platform_orders/show.blade.php +++ b/resources/views/admin/platform_orders/show.blade.php @@ -64,7 +64,7 @@ 订阅ID{{ $order->siteSubscription->id }} 订阅号{{ $order->siteSubscription->subscription_no }} - 订阅管理打开订阅管理(按订阅号筛选) + 订阅管理打开订阅详情 状态{{ $order->siteSubscription->status }} 开始/到期{{ optional($order->siteSubscription->starts_at)->format('Y-m-d H:i:s') ?: '-' }} / {{ optional($order->siteSubscription->ends_at)->format('Y-m-d H:i:s') ?: '-' }} diff --git a/tests/Feature/AdminPlatformOrderShowTest.php b/tests/Feature/AdminPlatformOrderShowTest.php index 701b0c2..4e95be6 100644 --- a/tests/Feature/AdminPlatformOrderShowTest.php +++ b/tests/Feature/AdminPlatformOrderShowTest.php @@ -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('清除同步失败标记'); }