统一仪表盘最近订单已付无回执前缀文案

This commit is contained in:
萝卜
2026-03-18 23:39:51 +08:00
parent 4226bf641e
commit 423f6ba1a5
2 changed files with 65 additions and 1 deletions

View File

@@ -1136,7 +1136,7 @@
{{ $po->payment_status }}
@if((string) $po->payment_status === 'paid' && ! $hasReceiptEvidence)
<div class="muted text-danger muted-xs row-warn" data-role="recent-order-no-receipt-hint" title="已付 ¥{{ number_format((float) $po->paid_amount, 2) }}|无回执证据">
<span class="row-warn-prefix">无回执</span>
<span class="row-warn-prefix">已付无回执</span>
<span class="muted"></span>
<a class="link" href="{!! $fixReceiptUrl !!}">去补回执</a>
<span class="muted"></span>

View File

@@ -0,0 +1,64 @@
<?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 AdminDashboardRecentPlatformOrdersPaidNoReceiptPrefixShouldUsePaidNoReceiptPhraseTest 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_recent_platform_orders_paid_no_receipt_prefix_should_use_paid_no_receipt_phrase(): void
{
$this->loginAsPlatformAdmin();
$merchant = Merchant::query()->firstOrFail();
$plan = Plan::query()->create([
'code' => 'dashboard_recent_paid_no_receipt_prefix_plan',
'name' => '仪表盘最近订单已付无回执前缀测试套餐',
'billing_cycle' => 'monthly',
'price' => 10,
'list_price' => 10,
'status' => 'active',
'sort' => 10,
'published_at' => now(),
]);
PlatformOrder::query()->create([
'merchant_id' => $merchant->id,
'plan_id' => $plan->id,
'order_no' => 'PO_DASHBOARD_PNR_PREFIX_0001',
'order_type' => 'new_purchase',
'status' => 'activated',
'payment_status' => 'paid',
'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(),
'meta' => [],
]);
$res = $this->get('/admin');
$res->assertOk();
$res->assertSee('<span class="row-warn-prefix">已付无回执</span>', false);
}
}