From 8fd2ffd1edd22bcd04f68edb01b2d7bb104a9b37 Mon Sep 17 00:00:00 2001 From: Lei OT Date: Tue, 28 Nov 2023 16:52:22 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20PayPal:=20=E7=BD=91=E7=AB=99=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E7=9A=84=E6=94=B6=E6=AC=BE=E8=AE=B0=E5=BD=95=E5=A4=84?= =?UTF-8?q?=E7=90=86,=20=E4=BD=BF=E7=94=A8=E4=B8=B4=E6=97=B6=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E8=AE=A2=E5=8D=95=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/third_party/paypal/controllers/index.php | 18 ++++++++++++++++++ webht/third_party/paypal/models/note_model.php | 8 ++++++++ 2 files changed, 26 insertions(+) diff --git a/webht/third_party/paypal/controllers/index.php b/webht/third_party/paypal/controllers/index.php index 5509160b..36e4d807 100644 --- a/webht/third_party/paypal/controllers/index.php +++ b/webht/third_party/paypal/controllers/index.php @@ -805,6 +805,11 @@ class Index extends CI_Controller { $data['unsend_list'] = $this->Note_model->unsend(10); } + // 处理失败 并 Completed + if (empty($data['unsend_list'])) { + $data['unsend_list'] = $this->Note_model->failnotec(20); + } + //没有未处理的数据再查找处理失败的数据 if (empty($data['unsend_list'])) { $data['unsend_list'] = $this->Note_model->failnote(20); @@ -907,6 +912,19 @@ class Index extends CI_Controller { //根据订单号查找外联信息 $advisor_info = $this->Paypal_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick); + //根据订单号查找外联信息, 从临时表 + $advisor_info_from_tmp = $this->Paypal_model->get_order($orderid_info->orderid, false, 'M', $handpick); + /** + * 传统订单, 网站支付 + * 已经录入, 后来重新生成订单号, 不再邮件通知了 + * @author LYT + */ + if (empty($advisor_info) && ! empty($advisor_info_from_tmp) && $orderid_info->ordertype == 'T') { + $this->Note_model->update_send($item->pn_txn_id, 'closeRecord', $item->pn_sn); + $this->Note_model->set_invoice($item->pn_txn_id, $advisor_info_from_tmp->COLI_ID . '_' . $orderid_info->ordertype); + continue; + } + // for trippest tourMaster 2018.05.28 if ($orderid_info->ordertype == 'TP') { $this->trippest_note($orderid_info, $item); diff --git a/webht/third_party/paypal/models/note_model.php b/webht/third_party/paypal/models/note_model.php index 75b336b1..bb5f1023 100644 --- a/webht/third_party/paypal/models/note_model.php +++ b/webht/third_party/paypal/models/note_model.php @@ -36,6 +36,14 @@ class Note_model extends CI_Model { return $this->get_list(); } + public function failnotec($topnum = 2) { + $this->init(); + $this->topnum = $topnum; + $this->pn_send = " AND (pn_send='sendfail' OR pn_send='') AND pn_payment_status='Completed' "; + //$this->orderby = ' ORDER BY pn.pn_sn ASC '; + return $this->get_list(); + } + public function failnote($topnum = 2) { $this->init(); $this->topnum = $topnum;