diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php
index 51efd08..1fb1048 100644
--- a/resources/views/admin/platform_orders/index.blade.php
+++ b/resources/views/admin/platform_orders/index.blade.php
@@ -761,9 +761,9 @@
建议按以下顺序治理当前筛选集合:
- - 先处理 对账不一致:优先补齐支付回执,并核对回执渠道/金额,确保回执总额与已付金额一致。
- - 再处理 退款不一致:优先补齐退款回执/核对退款轨迹/修正退款状态(带审计)。
- - 最后处理 可同步:确认无对账/退款异常、无同步失败原因后,再批量同步订阅。
+ - 先处理 对账不一致:优先补齐支付回执,并核对回执渠道/金额,确保回执总额与已付金额一致。
+ - 再处理 退款不一致:优先补齐退款回执/核对退款轨迹/修正退款状态(带审计)。
+ - 最后处理 可同步:确认无对账/退款异常、无同步失败原因后,再批量同步订阅。
diff --git a/tests/Feature/AdminPlatformOrderIndexSopLinksShouldHaveDataRoleAndKeepBackTest.php b/tests/Feature/AdminPlatformOrderIndexSopLinksShouldHaveDataRoleAndKeepBackTest.php
new file mode 100644
index 0000000..3a18c76
--- /dev/null
+++ b/tests/Feature/AdminPlatformOrderIndexSopLinksShouldHaveDataRoleAndKeepBackTest.php
@@ -0,0 +1,70 @@
+seed();
+
+ $this->post('/admin/login', [
+ 'email' => 'platform.admin@demo.local',
+ 'password' => 'Platform@123456',
+ ])->assertRedirect('/admin');
+ }
+
+ public function test_platform_orders_index_sop_links_should_have_data_role_and_keep_back(): void
+ {
+ $this->loginAsPlatformAdmin();
+
+ $res = $this->get('/admin/platform-orders?merchant_id=1&back=/admin&page=2');
+ $res->assertOk();
+
+ $html = (string) $res->getContent();
+
+ $cases = [
+ [
+ 'role' => 'po-sop-link-reconcile-mismatch',
+ 'expect' => ['reconcile_mismatch' => '1'],
+ ],
+ [
+ 'role' => 'po-sop-link-refund-inconsistent',
+ 'expect' => ['refund_inconsistent' => '1'],
+ ],
+ [
+ 'role' => 'po-sop-link-syncable',
+ 'expect' => ['syncable_only' => '1', 'sync_status' => 'unsynced'],
+ ],
+ ];
+
+ foreach ($cases as $c) {
+ $role = (string) ($c['role'] ?? '');
+ $this->assertNotSame('', $role);
+
+ $re = '/]*data-role="' . preg_quote($role, '/') . '"[^>]*href="([^"]+)"/u';
+ $this->assertMatchesRegularExpression($re, $html);
+ preg_match($re, $html, $m);
+
+ $rawHref = (string) ($m[1] ?? '');
+ $this->assertStringNotContainsString('&back=', $rawHref);
+
+ $href = html_entity_decode($rawHref);
+ $query = parse_url($href, PHP_URL_QUERY) ?: '';
+ parse_str($query, $q);
+
+ foreach (($c['expect'] ?? []) as $k => $v) {
+ $this->assertSame((string) $v, (string) ($q[$k] ?? ''), $role . ' missing expected ' . $k);
+ }
+
+ // SOP 链接应保留 back,并清空 page
+ $this->assertSame('/admin', (string) ($q['back'] ?? ''));
+ $this->assertArrayNotHasKey('page', $q);
+ }
+ }
+}