平台订单工具区:治理筛选下增加操作顺序提示

This commit is contained in:
萝卜
2026-03-11 08:19:08 +00:00
parent 82dd58a8c5
commit 200c2cff5a
2 changed files with 62 additions and 0 deletions

View File

@@ -256,6 +256,27 @@
<h3>工具</h3>
<div class="muted mb-10">清除仅影响订单 meta 中的失败标记,不改变订单/订阅状态。</div>
@php
$hasReconcileMismatchFilter = (($filters['reconcile_mismatch'] ?? '') === '1');
$hasRefundInconsistentFilter = (($filters['refund_inconsistent'] ?? '') === '1');
@endphp
@if($hasReconcileMismatchFilter || $hasRefundInconsistentFilter)
<div class="muted text-danger mb-10">
提示:当前筛选包含
@if($hasReconcileMismatchFilter)
<a class="link" href="{{ request()->fullUrlWithQuery(['reconcile_mismatch' => '1', 'page' => null]) }}">对账不一致</a>
@endif
@if($hasReconcileMismatchFilter && $hasRefundInconsistentFilter)
<span class="muted"></span>
@endif
@if($hasRefundInconsistentFilter)
<a class="link" href="{{ request()->fullUrlWithQuery(['refund_inconsistent' => '1', 'page' => null]) }}">退款不一致</a>
@endif
。建议先完成金额/状态治理(补回执/核对退款)后,再执行批量同步订阅等工具动作。
</div>
@endif
<form method="get" action="/admin/platform-orders/export" class="mb-10">
<input type="hidden" name="status" value="{{ $filters['status'] ?? '' }}">
<input type="hidden" name="payment_status" value="{{ $filters['payment_status'] ?? '' }}">

View File

@@ -0,0 +1,41 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderToolsGovernanceHintTest 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_tools_show_governance_hint_when_reconcile_mismatch_filter_present(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin/platform-orders?reconcile_mismatch=1')
->assertOk()
->assertSee('建议先完成金额/状态治理', false)
->assertSee('对账不一致', false);
}
public function test_platform_orders_tools_show_governance_hint_when_refund_inconsistent_filter_present(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin/platform-orders?refund_inconsistent=1')
->assertOk()
->assertSee('建议先完成金额/状态治理', false)
->assertSee('退款不一致', false);
}
}