platform_orders index: status meta line uses muted-xs

This commit is contained in:
萝卜
2026-03-14 12:55:06 +00:00
parent 70d67db89b
commit bff85a879a
2 changed files with 67 additions and 2 deletions

View File

@@ -1066,11 +1066,11 @@
<td class="col-optional">{{ $order->order_type }}</td> <td class="col-optional">{{ $order->order_type }}</td>
<td> <td>
{{ $statusLabels[$order->status] ?? $order->status }} {{ $statusLabels[$order->status] ?? $order->status }}
<div class="muted">{{ $order->status }}</div> <div class="muted muted-xs">{{ $order->status }}</div>
</td> </td>
<td> <td>
{{ $paymentStatusLabels[$order->payment_status] ?? $order->payment_status }} {{ $paymentStatusLabels[$order->payment_status] ?? $order->payment_status }}
<div class="muted">{{ $order->payment_status }}</div> <div class="muted muted-xs">{{ $order->payment_status }}</div>
@php @php
$hasReceiptEvidenceRow = (data_get($order->meta, 'payment_summary.total_amount') !== null) $hasReceiptEvidenceRow = (data_get($order->meta, 'payment_summary.total_amount') !== null)

View File

@@ -0,0 +1,65 @@
<?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 AdminPlatformOrderIndexStatusMetaUsesMutedXsTest 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_status_and_payment_status_raw_code_use_muted_xs(): void
{
$this->loginAsPlatformAdmin();
$merchant = Merchant::query()->firstOrFail();
$plan = Plan::query()->create([
'code' => 'po_index_status_muted_xs_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_INDEX_STATUS_MUTED_XS_0001',
'order_type' => 'new_purchase',
'status' => 'pending',
'payment_status' => 'unpaid',
'plan_name' => $plan->name,
'billing_cycle' => $plan->billing_cycle,
'period_months' => 1,
'quantity' => 1,
'payable_amount' => 10,
'paid_amount' => 0,
'placed_at' => now(),
'meta' => [],
]);
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$res->assertSee('<div class="muted muted-xs">pending</div>', false);
$res->assertSee('<div class="muted muted-xs">unpaid</div>', false);
}
}