平台订单列表 SOP 链接补齐 data-role 与 back 口径护栏
This commit is contained in:
@@ -761,9 +761,9 @@
|
||||
<div class="muted muted-xs">
|
||||
建议按以下顺序治理当前筛选集合:
|
||||
<ol class="muted-muted-xs list-indent">
|
||||
<li>先处理 <a class="link" href="{!! $safeFullUrlWithQuery(['reconcile_mismatch' => '1', 'page' => null]) !!}">对账不一致</a>:优先补齐支付回执,并核对回执渠道/金额,确保回执总额与已付金额一致。</li>
|
||||
<li>再处理 <a class="link" href="{!! $safeFullUrlWithQuery(['refund_inconsistent' => '1', 'page' => null]) !!}">退款不一致</a>:优先补齐退款回执/核对退款轨迹/修正退款状态(带审计)。</li>
|
||||
<li>最后处理 <a class="link" href="{!! $safeFullUrlWithQuery(['syncable_only' => '1', 'sync_status' => 'unsynced', 'page' => null]) !!}">可同步</a>:确认无对账/退款异常、无同步失败原因后,再批量同步订阅。</li>
|
||||
<li>先处理 <a data-role="po-sop-link-reconcile-mismatch" class="link" href="{!! $safeFullUrlWithQuery(['reconcile_mismatch' => '1', 'page' => null]) !!}">对账不一致</a>:优先补齐支付回执,并核对回执渠道/金额,确保回执总额与已付金额一致。</li>
|
||||
<li>再处理 <a data-role="po-sop-link-refund-inconsistent" class="link" href="{!! $safeFullUrlWithQuery(['refund_inconsistent' => '1', 'page' => null]) !!}">退款不一致</a>:优先补齐退款回执/核对退款轨迹/修正退款状态(带审计)。</li>
|
||||
<li>最后处理 <a data-role="po-sop-link-syncable" class="link" href="{!! $safeFullUrlWithQuery(['syncable_only' => '1', 'sync_status' => 'unsynced', 'page' => null]) !!}">可同步</a>:确认无对账/退款异常、无同步失败原因后,再批量同步订阅。</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="muted governance-block-footnote">说明:本页“批量同步/批量生效/清理失败标记”等工具动作会透传当前筛选条件;建议先缩小到明确集合再操作。</div>
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class AdminPlatformOrderIndexSopLinksShouldHaveDataRoleAndKeepBackTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function loginAsPlatformAdmin(): void
|
||||
{
|
||||
$this->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 = '/<a[^>]*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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user