From e750ac9cd297817ce7ed5f780e5adfe6582878b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Mon, 5 Aug 2024 21:32:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E5=BE=AE=E4=BF=A1V3?= =?UTF-8?q?=E6=8F=90=E7=8E=B0=E6=8E=A5=E5=8F=A3=E5=8F=82=E6=95=B0=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WePayV3/Transfers.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/WePayV3/Transfers.php b/WePayV3/Transfers.php index 7e3939b..d32289b 100644 --- a/WePayV3/Transfers.php +++ b/WePayV3/Transfers.php @@ -42,12 +42,12 @@ class Transfers extends BasicWePay foreach ($body['transfer_detail_list'] as &$item) if (isset($item['user_name'])) { $item['user_name'] = $this->rsaEncode($item['user_name']); } - } - if (empty($body['total_num'])) { - $body['total_num'] = count($body['transfer_detail_list']); - } - if (empty($body['total_amount'])) { - $body['total_amount'] = array_sum(array_column($body['transfer_detail_list'], 'transfer_amount')); + if (empty($body['total_num'])) { + $body['total_num'] = count($body['transfer_detail_list']); + } + if (empty($body['total_amount'])) { + $body['total_amount'] = array_sum(array_column($body['transfer_detail_list'], 'transfer_amount')); + } } return $this->doRequest('POST', '/v3/transfer/batches', json_encode($body, JSON_UNESCAPED_UNICODE), true); }