diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index 1fbd208a..17cef09e 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -1107,6 +1107,9 @@ class AlipayTradeService extends CI_Controller } } $data["paytext"] = $this->payment_status(); + $order_sn = empty($data['order_info']) ? 0 : $data['order_info']->COLI_SN; + $data['group_accout_info'] = + $this->Alipay_model->get_group_accout_info($order_sn, $data['note']->ALI_dealId); echo json_encode($this->load->view('alipay_note_setting', $data, true)); } diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php index ecaf6f39..5b78b985 100644 --- a/webht/third_party/pay/controllers/PaymentService.php +++ b/webht/third_party/pay/controllers/PaymentService.php @@ -462,6 +462,9 @@ class PaymentService extends CI_Controller { $data['order_info'] = $this->account_model->get_order($neworder_id->orderid, true, $neworder_id->ordertype, true); } } + $order_sn = empty($data['order_info']) ? 0 : $data['order_info']->COLI_SN; + $data['group_accout_info'] = + $this->account_model->get_group_accout_info($order_sn, $pn_txn_id); echo json_encode($this->load->view('payment_gai_setting', $data, true)); } diff --git a/webht/third_party/pay/models/Alipay_model.php b/webht/third_party/pay/models/Alipay_model.php index 65c3535a..fd1fe9e5 100644 --- a/webht/third_party/pay/models/Alipay_model.php +++ b/webht/third_party/pay/models/Alipay_model.php @@ -81,6 +81,30 @@ class Alipay_model extends CI_Model { return $result; } + /** + * 查找付款记录,用于判断是否已经审核。 + * 已经审核过得记录不能修改订单号。 + */ + public function get_group_accout_info($coli_sn, $pn_txn_id) { + // select * from BIZ_GroupAccountInfo where GAI_COLI_SN = 559007281 and GAI_AccreditNo = '91R84932UM059045C' + $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 + where GAI_COLI_SN = $coli_sn and GAI_AccreditNo = '$pn_txn_id'"; + + $info_query = $this->HT->query($info_sql); + $info_result = $info_query->result(); + $group_accout_info = array( + 'GAI_SN' => 0, + 'GAI_State' => 0 + ); + if (!empty($info_empty)) { + $group_accout_info = $info_result[0]; + } + return $group_accout_info; + } + //获取收款记录(商务订单) public function get_money_list($GAI_COLI_ID, $GAI_SQJE, $GAI_SQJECurrency) { $sql = "SELECT GAI_SN,GAI_CusEmail,GAI_Memo 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 5db785f8..dba7525f 100644 --- a/webht/third_party/pay/models/Online_payment_account_model.php +++ b/webht/third_party/pay/models/Online_payment_account_model.php @@ -97,6 +97,29 @@ class Online_payment_account_model extends CI_Model { return $result; } + /** + * 查找付款记录,用于判断是否已经审核。 + * 已经审核过得记录不能修改订单号。 + */ + public function get_group_accout_info($coli_sn, $pn_txn_id) { + $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 + where GAI_COLI_SN = $coli_sn and GAI_AccreditNo = '$pn_txn_id'"; + + $info_query = $this->HT->query($info_sql); + $info_result = $info_query->result(); + $group_accout_info = array( + 'GAI_SN' => 0, + 'GAI_State' => 0 + ); + if (!empty($info_empty)) { + $group_accout_info = $info_result[0]; + } + return $group_accout_info; + } + public function if_biz_gai_exists($GAI_AccreditNo, $is_app=false, $coli_sn=null, $je=null, $type=null) { if ($is_app===true && $coli_sn!==null) { diff --git a/webht/third_party/pay/views/alipay_note_setting.php b/webht/third_party/pay/views/alipay_note_setting.php index 1f95cc3e..d3e7c8b6 100644 --- a/webht/third_party/pay/views/alipay_note_setting.php +++ b/webht/third_party/pay/views/alipay_note_setting.php @@ -33,10 +33,19 @@
analysis_orderid($pn_invoice); } else { $orderid_info = $this->analysis_orderid($data['note']->pn_invoice); - } + } + $data['pn_invoice'] = $pn_invoice ? $pn_invoice : $data['note']->pn_invoice; if (!empty($orderid_info)) { $orderid_info = json_decode($orderid_info); $data['order_info'] = $this->Paypal_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype); } - $data['pn_invoice'] = $pn_invoice ? $pn_invoice : $data['note']->pn_invoice ; + + $order_sn = empty($data['order_info']) ? 0 : $data['order_info']->COLI_SN; + $data['group_accout_info'] = + $this->Paypal_model->get_group_accout_info($order_sn, $data['note']->pn_txn_id); echo json_encode($this->load->view('note_setting', $data, true)); return true; } diff --git a/webht/third_party/paypal/models/paypal_model.php b/webht/third_party/paypal/models/paypal_model.php index f31216f9..de8fd5f0 100644 --- a/webht/third_party/paypal/models/paypal_model.php +++ b/webht/third_party/paypal/models/paypal_model.php @@ -86,6 +86,30 @@ class Paypal_model extends CI_Model { return $result; } + /** + * 查找付款记录,用于判断是否已经审核。 + * 已经审核过得记录不能修改订单号。 + */ + public function get_group_accout_info($coli_sn, $pn_txn_id) { + // select * from BIZ_GroupAccountInfo where GAI_COLI_SN = 559007281 and GAI_AccreditNo = '91R84932UM059045C' + $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 + where GAI_COLI_SN = $coli_sn and GAI_AccreditNo = '$pn_txn_id'"; + + $info_query = $this->HT->query($info_sql); + $info_result = $info_query->result(); + $group_accout_info = array( + 'GAI_SN' => 0, + 'GAI_State' => 0 + ); + if (!empty($info_empty)) { + $group_accout_info = $info_result[0]; + } + return $group_accout_info; + } + //获取收款记录(商务订单) public function get_money_list($GAI_COLI_ID, $GAI_SQJE=null, $GAI_SQJECurrency=null) { $je_sql = $GAI_SQJE===null ? " " : " and GAI_SQJE=? "; diff --git a/webht/third_party/paypal/views/note_setting.php b/webht/third_party/paypal/views/note_setting.php index 241f3bc6..f1badbdd 100644 --- a/webht/third_party/paypal/views/note_setting.php +++ b/webht/third_party/paypal/views/note_setting.php @@ -43,12 +43,21 @@