From 85026d3c0e9a199daa50fa787c985c352ab440bd Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 25 May 2023 17:35:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/PaymentService.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/service/PaymentService.php b/app/service/PaymentService.php index da4c1fb3d..86b5eb21a 100755 --- a/app/service/PaymentService.php +++ b/app/service/PaymentService.php @@ -1188,9 +1188,9 @@ php; */ public static function BuyDefaultPayment($params = []) { - if(empty($params['payment_id'])) + $payment_id = 0; + if(empty($params) || empty($params['payment_id'])) { - $payment_id = 0; $default_payment = MyC('common_default_payment'); if(!empty($default_payment) && !empty($default_payment[APPLICATION_CLIENT_TYPE])) { @@ -1201,9 +1201,10 @@ php; ]; $payment_id = Db::name('Payment')->where($where)->value('id'); } - $params['payment_id'] = empty($payment_id) ? 0 : $payment_id; + } else { + $payment_id = $params['payment_id']; } - return $params['payment_id']; + return $payment_id; } } ?> \ No newline at end of file