From d5eab40a4be5ac7c5379c0db0d6643d8cc7b366b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Thu, 19 Mar 2026 00:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BE=84=E6=B8=85=E6=89=B9=E9=87=8F=E6=B2=BB?= =?UTF-8?q?=E7=90=86=E6=97=A0=E5=9B=9E=E6=89=A7=E5=B9=BF=E4=B9=89=E7=AD=9B?= =?UTF-8?q?=E9=80=89=E6=8F=90=E7=A4=BA=E5=8F=A3=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/PlatformOrderController.php | 4 +-- ...ShouldClarifyBroadReceiptNoneScopeTest.php | 35 +++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 tests/Feature/AdminPlatformOrderBatchSyncWarningsShouldClarifyBroadReceiptNoneScopeTest.php diff --git a/app/Http/Controllers/Admin/PlatformOrderController.php b/app/Http/Controllers/Admin/PlatformOrderController.php index db3b4a9..fc02e43 100644 --- a/app/Http/Controllers/Admin/PlatformOrderController.php +++ b/app/Http/Controllers/Admin/PlatformOrderController.php @@ -1610,7 +1610,7 @@ class PlatformOrderController extends Controller if ($scope === 'filtered' && ($filters['syncable_only'] ?? '') === '1' && ((string) ($filters['receipt_status'] ?? '') === 'none')) { - return redirect()->back()->with('warning', '当前筛选为「无回执」订单集合。为保证收费闭环可治理,请先补齐支付回执留痕后再批量同步订阅。'); + return redirect()->back()->with('warning', '当前筛选为「无回执(广义)」订单集合。为保证收费闭环可治理,请先补齐支付回执留痕后再批量同步订阅。'); } // 防误操作(口径一致):当用户显式传入了 status/payment_status 时,要求口径至少锁定「已支付+已生效」 @@ -1939,7 +1939,7 @@ class PlatformOrderController extends Controller // 治理优先:当用户显式筛选「无回执」时,不允许直接批量生效 if ((string) ($filters['receipt_status'] ?? '') === 'none') { - return redirect()->back()->with('warning', '当前筛选为「无回执」订单集合。为保证收费闭环可治理,请先补齐支付回执留痕后再执行批量仅标记为已生效。'); + return redirect()->back()->with('warning', '当前筛选为「无回执(广义)」订单集合。为保证收费闭环可治理,请先补齐支付回执留痕后再执行批量仅标记为已生效。'); } // 治理优先:当用户显式筛选「有退款」时,不允许直接批量生效 diff --git a/tests/Feature/AdminPlatformOrderBatchSyncWarningsShouldClarifyBroadReceiptNoneScopeTest.php b/tests/Feature/AdminPlatformOrderBatchSyncWarningsShouldClarifyBroadReceiptNoneScopeTest.php new file mode 100644 index 0000000..b071fbf --- /dev/null +++ b/tests/Feature/AdminPlatformOrderBatchSyncWarningsShouldClarifyBroadReceiptNoneScopeTest.php @@ -0,0 +1,35 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_batch_activate_subscriptions_warning_should_clarify_broad_receipt_none_scope(): void + { + $this->loginAsPlatformAdmin(); + + $syncRes = $this->post('/admin/platform-orders/batch-activate-subscriptions', [ + 'scope' => 'filtered', + 'receipt_status' => 'none', + 'syncable_only' => '1', + ]); + $syncRes->assertRedirect(); + $syncRes->assertSessionHas('warning'); + $this->assertStringContainsString('无回执(广义)', (string) session('warning')); + } +}