平台订单列表:退款不一致行提示补齐去核对退款入口

This commit is contained in:
萝卜
2026-03-11 08:15:15 +00:00
parent fc40dcee05
commit 2730d656b1
2 changed files with 77 additions and 1 deletions

View File

@@ -661,8 +661,13 @@
@endphp
@if($refundTotal > 0)
@if($isRefundInconsistent)
@php $refundFixUrl = '/admin/platform-orders/' . $order->id . '#refund-receipts'; @endphp
<a class="link text-danger" href="{{ $refundShowUrl }}">¥{{ number_format($refundTotal, 2) }}</a>
<div class="muted text-danger muted-xs">疑似不一致</div>
<div class="muted text-danger muted-xs">
疑似不一致
<span class="muted"></span>
<a class="link" href="{{ $refundFixUrl }}">去核对退款</a>
</div>
@else
<a class="muted" href="{{ $refundShowUrl }}">¥{{ number_format($refundTotal, 2) }}</a>
@endif

View File

@@ -0,0 +1,71 @@
<?php
namespace Tests\Feature;
use App\Models\Merchant;
use App\Models\Plan;
use App\Models\PlatformOrder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderRefundInconsistentRowHintFixLinkTest 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_row_refund_inconsistent_hint_has_fix_link_to_refund_section(): void
{
$this->loginAsPlatformAdmin();
$merchant = Merchant::query()->firstOrFail();
$plan = Plan::query()->create([
'code' => 'refund_inconsistent_fix_link_test',
'name' => '退款不一致修复链接测试套餐',
'billing_cycle' => 'monthly',
'price' => 10,
'list_price' => 10,
'status' => 'active',
'sort' => 10,
'published_at' => now(),
]);
$order = PlatformOrder::query()->create([
'merchant_id' => $merchant->id,
'plan_id' => $plan->id,
'order_no' => 'PO_REFUND_INCONS_FIX_0001',
'order_type' => 'new_purchase',
'status' => 'activated',
'payment_status' => 'refunded',
'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(),
'refunded_at' => now(),
'meta' => [
'refund_summary' => [
'count' => 1,
'total_amount' => 9.98,
],
],
]);
$this->get('/admin/platform-orders?refund_inconsistent=1')
->assertOk()
->assertSee('/admin/platform-orders/' . $order->id . '#refund-receipts', false)
->assertSee('去核对退款');
}
}