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;