paypal 订单号匹配多条记录时,需手动请求录入,录入最佳匹配

feature/trippest
lyt 7 years ago
parent fea962dd95
commit c87204653d

@ -786,7 +786,8 @@ class Index extends CI_Controller {
//根据订单号查找外联信息
$orderid_info = json_decode($orderid_info);
$advisor_info = $this->Paypal_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
$handpick = empty($pn_txn_id) ? false : TRUE;
$advisor_info = $this->Paypal_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick);
// for trippest tourMaster 2018.05.28
if ($orderid_info->ordertype == 'TP') {
@ -1222,7 +1223,7 @@ class Index extends CI_Controller {
$orderid_info = $this->analysis_orderid($neworder);
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
$advisor_info = $this->Paypal_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
$advisor_info = $this->Paypal_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, TRUE);
if (!empty($advisor_info)) {
$this->Note_model->set_invoice($pn_txn_id, $neworder);
$this->send_note($pn_txn_id, $old_ssje);

@ -14,7 +14,7 @@ class Paypal_model extends CI_Model {
}
//根据订单号获取外联邮箱
public function get_order($COLI_ID, $orderinfo = false, $ordertype = 'N') {
public function get_order($COLI_ID, $orderinfo = false, $ordertype = 'N', $handpick=false) {
$result = '';
$fieldsql = $orderinfo == false ? '' : " ,* ";
//先查商务订单B,APP订单A、再查传统订单T
@ -29,9 +29,13 @@ class Paypal_model extends CI_Model {
if (empty($result) && ($ordertype == 'T')) {
$sql = "SELECT TOP 2 1 as order_type, COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_ID like '%$COLI_ID'";
where COLI_ID like '%$COLI_ID'
order by CHARINDEX('$COLI_ID', COLI_ID) ";
$query = $this->HT->query($sql);
$result = $query->result();
if ($handpick === TRUE) {
$result = array($result[0]);
}
}
//查传统订单add_code网前实时支付会先生成一个临时订单号存在add_code里如订单45103248

Loading…
Cancel
Save