From 098316794b3b4c1d6016f944ebf631bebb72a59a Mon Sep 17 00:00:00 2001 From: Lei OT Date: Wed, 26 Mar 2025 13:58:35 +0800 Subject: [PATCH] =?UTF-8?q?wxpay:=20=E8=AE=B0=E5=BD=95=20payment=20Source;?= =?UTF-8?q?=20=E8=B4=A6=E5=8D=95=E5=BD=95=E5=85=A5,=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/pay/controllers/WxpayService.php | 8 +++++--- .../pay/models/Online_payment_note_model.php | 12 +++++++++++- webht/third_party/pay/views/payment_list.php | 12 ++++++------ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/webht/third_party/pay/controllers/WxpayService.php b/webht/third_party/pay/controllers/WxpayService.php index 06da38d9..641c4e4a 100644 --- a/webht/third_party/pay/controllers/WxpayService.php +++ b/webht/third_party/pay/controllers/WxpayService.php @@ -54,7 +54,7 @@ class WxpayService extends CI_Controller { $save_column['OPN_orderId'] = $xml_arr['out_trade_no']; $save_column['OPN_rawOrderId'] = $xml_arr['out_trade_no']; $save_column['OPN_invoiceId'] = $xml_arr['out_trade_no']; - $save_column['OPN_subject'] = $xml_arr['attach'] ? $xml_arr['attach'] : $xml_arr['out_trade_no']; + $save_column['OPN_subject'] = $xml_arr['attach'] ? $xml_arr['attach'] : ''; $save_column['OPN_currency'] = $xml_arr['fee_type']; $save_column['OPN_orderAmount'] = $xml_arr['total_fee']; $save_column['OPN_payAmount'] = $xml_arr['total_fee']; @@ -65,7 +65,7 @@ class WxpayService extends CI_Controller { $save_column['OPN_errMsg'] = isset($xml_arr['err_code_des']) ? $xml_arr['err_code_des'] : NULL; $save_column['OPN_acquiringTime'] = date('Y-m-d H:i:s',strtotime($xml_arr['time_end'])); $save_column['OPN_completeTime'] = date('Y-m-d H:i:s',strtotime($xml_arr['time_end'])); - $save_column['OPN_remark'] = $xml_arr['attach'] ? $xml_arr['attach'] : $xml_arr['out_trade_no']; + $save_column['OPN_remark'] = $xml_arr['attach'] ? $xml_arr['attach'] : ''; $save_column['OPN_payerLogId'] = $xml_arr['openid']; $save_column['OPN_payerStatus'] = $xml_arr['is_subscribe']==='Y' ? "subscribed" : NULL; $save_column['OPN_fundSource'] = $site; @@ -77,6 +77,7 @@ class WxpayService extends CI_Controller { $save_column['OPN_noticeSendStatus'] = 'unsend'; $save_column['OPN_noticeSendTime'] = NULL; $save_column['OPN_accountMethod'] = $this->config->item('method_code', 'wxpay'); + $save_column['OPN_paymentSource'] = $xml_arr['bank_type']; if ( $this->note_model->insert_note($save_column) ) { $response['return_code'] = 'SUCCESS'; $response['return_msg'] = 'OK'; @@ -151,6 +152,7 @@ class WxpayService extends CI_Controller { $save_column['OPN_entryAmountCNY'] = floatval($ssje); $save_column['OPN_noticeType'] = 'pay'; $save_column['OPN_relatedId'] = ''; + $save_column['OPN_paymentSource'] = $row['bank_type']; } $save_column['OPN_noticeSendStatus'] = 'unsend'; $save_column['OPN_transactionResult'] = 'completed'; @@ -167,7 +169,7 @@ class WxpayService extends CI_Controller { $save_column['OPN_rawContent'] = json_encode($row); $save_column['OPN_noticeTime'] = date('Y-m-d H:i:s'); - $this->note_model->insert_note($save_column) ; + $this->note_model->insert_note($save_column); } return; } 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 0bf4c93c..303d2472 100644 --- a/webht/third_party/pay/models/Online_payment_note_model.php +++ b/webht/third_party/pay/models/Online_payment_note_model.php @@ -27,11 +27,21 @@ class Online_payment_note_model extends CI_Model { return $this->info->query($ret, array($refund_id))->num_rows() > 0; } - public function insert_note($column) + public function insert_note($column, $check_exists = false) { if ($column === null) { return false; } + if ($check_exists === true) { + $sql = "SELECT TOP 1 1 + FROM OnlinePaymentNote + WHERE OPN_accountMethod={$column['OPN_accountMethod']} AND OPN_transactionId = '{$column['OPN_transactionId']}'"; + $query = $this->info->query($sql); + if ($query->num_rows() > 0) { + // todo: update pay_fee, CNY ssje + return false; + } + } $this->info->insert('OnlinePaymentNote', $column); $ret = "SELECT TOP 1 * FROM OnlinePaymentNote WHERE OPN_transactionId=? ORDER BY OPN_SN DESC "; return $this->info->query($ret, array($column['OPN_transactionId']))->row(); diff --git a/webht/third_party/pay/views/payment_list.php b/webht/third_party/pay/views/payment_list.php index 8a3a6843..71fa8ea1 100644 --- a/webht/third_party/pay/views/payment_list.php +++ b/webht/third_party/pay/views/payment_list.php @@ -29,10 +29,10 @@ .wechat-color {background-color: #62B900;} .paypal-color {background-color: #002D89;} .alipay-color {background-color: #00AAEE;} - .ipaylinks-color,.creditcard-color,.creditcard-ipaylinks-color {background-color: #A31022;} + .ipaylinks-color,.creditcard-color,.creditcard-ipaylinks-color {background-color: #AD1818;} .creditcard-lianlian-color {background-color: #1985ff;} .modal {background-color: rgba(0,0,0,0.075);} - .cht-color {background-color: #A31022;} + .cht-color {background-color: #AD1818;} .trippest-color {background-color: #E83201;} .app-color {background-color: #EC3A4F;} @@ -164,9 +164,9 @@ class="text-muted" href="'15018,15035')) ?>">信用卡»   - + class="text-muted" + href="15015)) ?>">支付宝» +   │  @@ -245,7 +245,7 @@ brand_name))."-color"; ?>">brand_name; ?> - OPN_fundSource))."-color"; ?>">OPN_fundSource; ?> + OPN_fundSource)))."-color"; ?>">OPN_fundSource); ?> OPN_orderId . ' / ' . $item->OPN_orderAmount . $item->OPN_currency; ?>