From 53d30cc9fd80ca6d7a71b776f21fedce0f10fd0c Mon Sep 17 00:00:00 2001 From: Lei OT Date: Mon, 11 Dec 2023 16:05:01 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=BE=AE=E4=BF=A1=E6=94=B6=E6=AC=BE?= =?UTF-8?q?=E8=AE=B0=E5=BD=95:=20=E6=98=BE=E7=A4=BA=E6=9D=A5=E6=BA=90?= =?UTF-8?q?=E7=9A=84APPID=20=E7=9A=84=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/config/wxpay.php | 1 + .../pay/controllers/AlipayTradeService.php | 5 ++++ .../pay/controllers/PaymentService.php | 28 +++++++++++++++++++ .../models/Online_payment_account_model.php | 6 ++-- .../pay/models/Online_payment_note_model.php | 3 ++ webht/third_party/pay/views/payment_list.php | 18 +++++++----- .../third_party/paypal/controllers/index.php | 4 ++- .../third_party/paypal/models/note_model.php | 5 +++- 8 files changed, 58 insertions(+), 12 deletions(-) diff --git a/webht/third_party/pay/config/wxpay.php b/webht/third_party/pay/config/wxpay.php index 2f0f4888..7401ce27 100644 --- a/webht/third_party/pay/config/wxpay.php +++ b/webht/third_party/pay/config/wxpay.php @@ -27,3 +27,4 @@ $config['cht']["app_id"] = "wxd6c8dd69af5128cd"; $config['cht']["mch_id"] = "1353239702"; $config['cht']["key"] = "aada7476b3fecc2c6e33a7c765298516"; $config['cht']["app_secret"] = ""; +// wx5d01021a6d515098 花梨鹰小程序 diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index 3f73ef2e..d2df86b7 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -583,6 +583,11 @@ class AlipayTradeService extends CI_Controller //订单号 $orderid_info = analysis_orderid($parent_note->ALI_orderId); $orderid_info = json_decode($orderid_info); + //查不到订单信息 + if (empty($orderid_info)) { + $this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail'); + return false; + } //根据订单号查找外联信息 $advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick); //查不到订单信息 diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php index d5a8b6cb..3b18ce76 100644 --- a/webht/third_party/pay/controllers/PaymentService.php +++ b/webht/third_party/pay/controllers/PaymentService.php @@ -72,18 +72,36 @@ class PaymentService extends CI_Controller { $this->permission->is_admin(true); $data = array(); $data['date'] = date('Y-m-d'); + $data['method_code'] = '15016'; + $data["method_name"] = $this->code_brandname['15016']; $data['notelist'] = $this->note_model->sendfail_note(false); array_walk($data["notelist"], 'PaymentService::set_brandname'); $this->load->view("payment_list",$data); return; } + private $wxpay_app = array( + "wx749246dd935ca07b" => "APP", + "wx5d01021a6d515098" => "HLY", // "花梨鹰小程序", // 交行收款码 + "wxd6c8dd69af5128cd" => "", // "NATIVE", + "wx7e605820faf98a05" => "Trippest-NATIVE", + "0" => "unknown", + ); public function set_brandname(&$ele) { $ele->brand_name = "none"; if ($this->code_brandname[$ele->OPN_accountMethod]) { $ele->brand_name = $this->code_brandname[$ele->OPN_accountMethod]; } + + $raw = json_decode($ele->OPN_rawContent); + $wx_app = isset($raw->app_id) ? $raw->app_id : '0'; + $wx_app = $wx_app!=='0' ? $wx_app : (isset($raw->appid) ? $raw->appid : '0'); + + $ele->app_name = ""; + if ($this->wxpay_app[$wx_app]) { + $ele->app_name = $this->wxpay_app[$wx_app]; + } } // https://www.mycht.cn/webht.php/apps/pay/paymentservice/test_new_function?coli_sn=WY211210012 @@ -273,6 +291,16 @@ class PaymentService extends CI_Controller { $opi_email = 'contact@arachina.com'; $opi_firstname = 'contact@arachina.com'; } + + /** + * 已经记录的再次遇到就忽略了 + * @author LYT + */ + if (empty($opi_email) && $item->OPN_accountStatus === 'recorded') { + $this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'closed'); + continue; + } + //没有外联信息表示订单未分配 if (empty($opi_email) || empty($opi_firstname)) { $this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'sendfail'); diff --git a/webht/third_party/pay/models/Online_payment_account_model.php b/webht/third_party/pay/models/Online_payment_account_model.php index dba7525f..aab304f5 100644 --- a/webht/third_party/pay/models/Online_payment_account_model.php +++ b/webht/third_party/pay/models/Online_payment_account_model.php @@ -45,7 +45,7 @@ class Online_payment_account_model extends CI_Model { $query = $this->HT->query($sql); $result = $query->result(); if ($handpick === TRUE) { - $result = array($result[0]); + $result = empty($result) ? [] : array($result[0]); } } @@ -102,10 +102,10 @@ class Online_payment_account_model extends CI_Model { * 已经审核过得记录不能修改订单号。 */ public function get_group_accout_info($coli_sn, $pn_txn_id) { - $info_sql = "select GAI_SN, GAI_State from BIZ_GroupAccountInfo + $info_sql = "select GAI_SN, GAI_State from BIZ_GroupAccountInfo where GAI_COLI_SN = $coli_sn and GAI_AccreditNo = '$pn_txn_id' union - select GAI_SN, GAI_State from GroupAccountInfo + select GAI_SN, GAI_State from GroupAccountInfo where GAI_COLI_SN = $coli_sn and GAI_AccreditNo = '$pn_txn_id'"; $info_query = $this->HT->query($info_sql); diff --git a/webht/third_party/pay/models/Online_payment_note_model.php b/webht/third_party/pay/models/Online_payment_note_model.php index 3080a673..7ab43b39 100644 --- a/webht/third_party/pay/models/Online_payment_note_model.php +++ b/webht/third_party/pay/models/Online_payment_note_model.php @@ -85,6 +85,9 @@ class Online_payment_note_model extends CI_Model { $this->init_query(); $this->topnum = $num; $this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; + // 1小时前 + $date = date("Y-m-d H:i:s", time() - 3600); + $this->search .= $num !== false ? " AND OPN_noticeSendTime < '$date' " : ''; $this->send = " AND OPN_noticeSendStatus='sendfail' "; return $this->query_note(); } diff --git a/webht/third_party/pay/views/payment_list.php b/webht/third_party/pay/views/payment_list.php index 9847b740..38e325f0 100644 --- a/webht/third_party/pay/views/payment_list.php +++ b/webht/third_party/pay/views/payment_list.php @@ -29,6 +29,9 @@ .modal {background-color: rgba(0,0,0,0.075);} .cht-color {background-color: #A31022;} .trippest-color {background-color: #E83201;} + + .app-color {background-color: #EC3A4F;} + .hly-color {background-color: #009fe9;}