From 71622c87b3db351f05d1afe5b548c5280d8240e5 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 19 Sep 2019 14:37:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20WeChatPay=20=E9=A1=B5=E9=9D=A2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/PaymentService.php | 45 ++++++++++--------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php index 5af49913..674c8270 100644 --- a/webht/third_party/pay/controllers/PaymentService.php +++ b/webht/third_party/pay/controllers/PaymentService.php @@ -32,27 +32,7 @@ class PaymentService extends CI_Controller { } else { $data['notelist'] = $this->note_model->search_date($data['date']); } - array_walk($data["notelist"], function(&$ele, $key) - { - $ele->brand_name = "none"; - switch ($ele->OPN_accountMethod) { - case '15016': - $ele->brand_name = "WeChat"; - break; - case '15010': - case '15002': - $ele->brand_name = "PayPal"; - break; - case '15018': - $ele->brand_name = "Credit Card"; - break; - case '15015': - $ele->brand_name = "Alipay"; - break; - default: - break; - } - }); + array_walk($data["notelist"], 'PaymentService::set_brandname'); /** * 导出记录用的记录节点 @@ -70,10 +50,33 @@ class PaymentService extends CI_Controller { $data = array(); $data['date'] = date('Y-m-d'); $data['notelist'] = $this->note_model->failnote(100); + array_walk($data["notelist"], 'PaymentService::set_brandname'); $this->load->view("payment_list",$data); return; } + public function set_brandname(&$ele) + { + $ele->brand_name = "none"; + switch ($ele->OPN_accountMethod) { + case '15016': + $ele->brand_name = "WeChat"; + break; + case '15010': + case '15002': + $ele->brand_name = "PayPal"; + break; + case '15018': + $ele->brand_name = "Credit Card"; + break; + case '15015': + $ele->brand_name = "Alipay"; + break; + default: + break; + } + } + public function send_notify($opn_id=NULL, $old_ssje=NULL) { ignore_user_abort(true);