From 9164d84c8220fcfdc6ceb3b6708bff06e2bff533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 10 Mar 2026 17:01:40 +0000 Subject: [PATCH] =?UTF-8?q?feat(platform-orders):=20=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=80=80=E6=AC=BE=E6=80=BB=E9=A2=9D=E5=B9=B6?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E9=80=80=E6=AC=BE=E5=BF=AB=E6=8D=B7=E5=85=A5?= =?UTF-8?q?=E5=8F=A3=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/admin/platform_orders/index.blade.php | 17 ++++++++++++++++- tests/Feature/AdminPlatformOrderTest.php | 4 ++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index 032bc1f..b460363 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -308,6 +308,7 @@ 最近批量生效 回执数 退款数 + 退款总额 操作 @@ -440,7 +441,8 @@ @php - $refundCount = count((array) (data_get($order->meta, 'refund_receipts', []) ?? [])); + $refunds = (array) (data_get($order->meta, 'refund_receipts', []) ?? []); + $refundCount = count($refunds); @endphp @if($refundCount > 0) {{ $refundCount }} @@ -448,6 +450,19 @@ 0 @endif + + @php + $refundTotal = 0.0; + foreach ($refunds as $r) { + $refundTotal += (float) (data_get($r, 'amount') ?? 0); + } + @endphp + @if($refundTotal > 0) + ¥{{ number_format($refundTotal, 2) }} + @else + - + @endif + @php $canActivate = ($order->payment_status === 'paid') && ($order->status === 'activated'); diff --git a/tests/Feature/AdminPlatformOrderTest.php b/tests/Feature/AdminPlatformOrderTest.php index 739d8cc..0e24307 100644 --- a/tests/Feature/AdminPlatformOrderTest.php +++ b/tests/Feature/AdminPlatformOrderTest.php @@ -41,6 +41,10 @@ class AdminPlatformOrderTest extends TestCase ->assertSee('待支付') ->assertSee('待生效') ->assertSee('可同步订阅') + ->assertSee('部分退款') + ->assertSee('已退款') + ->assertSee('退款数') + ->assertSee('退款总额') ->assertSee('/admin/platform-orders?payment_status=paid&status=pending', false); }