From 454140d7010a21d1a6908f3ceba118c028395d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Sat, 14 Mar 2026 13:01:09 +0000 Subject: [PATCH] platform_orders index: subscription id prefix uses muted-xs span --- .../admin/platform_orders/index.blade.php | 3 +- ...dexSubscriptionIdPrefixUsesMutedXsTest.php | 81 +++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminPlatformOrderIndexSubscriptionIdPrefixUsesMutedXsTest.php diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index 931752f..301cbe2 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -1147,7 +1147,8 @@ {{ $order->siteSubscription->subscription_no }}
- 订阅ID:{{ $order->siteSubscription->id }} + 订阅ID: + {{ $order->siteSubscription->id }}
@else - diff --git a/tests/Feature/AdminPlatformOrderIndexSubscriptionIdPrefixUsesMutedXsTest.php b/tests/Feature/AdminPlatformOrderIndexSubscriptionIdPrefixUsesMutedXsTest.php new file mode 100644 index 0000000..57f73b9 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexSubscriptionIdPrefixUsesMutedXsTest.php @@ -0,0 +1,81 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_subscription_id_prefix_is_wrapped_by_muted_xs_span(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + + $plan = Plan::query()->create([ + 'code' => 'po_index_sub_id_prefix_muted_xs_plan', + 'name' => '平台订单列表订阅ID前缀样式测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 10, + 'list_price' => 10, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + $sub = SiteSubscription::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => $plan->id, + 'status' => 'active', + 'source' => 'test', + 'subscription_no' => 'SS_SUB_ID_PREFIX_0001', + 'plan_name' => $plan->name, + 'billing_cycle' => $plan->billing_cycle, + 'period_months' => 1, + 'amount' => 10, + 'starts_at' => now(), + 'ends_at' => now()->addMonth(), + ]); + + PlatformOrder::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => $plan->id, + 'site_subscription_id' => $sub->id, + 'order_no' => 'PO_INDEX_SUB_ID_PREFIX_0001', + 'order_type' => 'renewal', + 'status' => 'activated', + 'payment_status' => 'paid', + 'plan_name' => $plan->name, + 'billing_cycle' => $plan->billing_cycle, + 'period_months' => 1, + 'quantity' => 1, + 'payable_amount' => 10, + 'paid_amount' => 10, + 'placed_at' => now(), + 'paid_at' => now(), + 'activated_at' => now(), + 'meta' => [], + ]); + + $this->get('/admin/platform-orders?keyword=PO_INDEX_SUB_ID_PREFIX_0001') + ->assertOk() + ->assertSee('订阅ID:', false); + } +}