From 9af866f8c386a0b0366e48994781beef31f30775 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 9 Oct 2024 21:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/think-plugs-payment/src/service/Payment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/think-plugs-payment/src/service/Payment.php b/plugin/think-plugs-payment/src/service/Payment.php index 6548e515a..59ba6dc57 100644 --- a/plugin/think-plugs-payment/src/service/Payment.php +++ b/plugin/think-plugs-payment/src/service/Payment.php @@ -461,8 +461,8 @@ abstract class Payment 'sum(used_balance-refund_balance)' => 'balance', 'sum(used_integral-refund_integral)' => 'integral', ])->group('channel_type')->select()->map(static function (PluginPaymentRecord $item) use (&$total) { - $type = $item->getAttr('channel_type'); $total['amount'] = round($total['amount'] + $item->getAttr('amount'), 2); + $type = $item->getAttr('channel_type'); if (!in_array($type, [self::INTEGRAL, self::BALANCE])) $type = 'payment'; $total[$type] = round($total[$type] + $item[$type] ?? 0, 2); }); @@ -484,8 +484,8 @@ abstract class Payment PluginPaymentRefund::mk()->where(['record_code' => $pCode, 'refund_status' => [0, 1]])->field([ 'refund_account', 'sum(refund_amount) amount', 'sum(used_payment)' => 'payment', 'sum(used_balance)' => 'balance', 'sum(used_integral)' => 'integral', ])->group('refund_account')->select()->map(static function (PluginPaymentRefund $item) use (&$total) { - $type = $item->getAttr('refund_account'); $total['amount'] = round($total['amount'] + $item->getAttr('amount'), 2); + $type = $item->getAttr('refund_account'); if (!in_array($type, [self::INTEGRAL, self::BALANCE])) $type = 'payment'; $total[$type] = round($total[$type] + $item[$type] ?? 0, 2); });