Merge branch 'feature/pay'

mobile-first
lyt 6 years ago
commit 5a96b07c04

@ -349,7 +349,7 @@ class AlipayTradeService extends CI_Controller
if (empty($data['unsend_list'])) {
$data['unsend_list'] = $this->Alipay_note_model->failnote(20);
}
$handpick = empty($pn_txn_id) ? false : true;
$show_index = 0;
foreach ($data['unsend_list'] as $item) {
@ -366,7 +366,7 @@ class AlipayTradeService extends CI_Controller
//退款状态默认为已经处理,陆燕在退款前手动通知外联了,系统跳过处理
if ($item->ALI_payType == 'refund') {
$this->send_refund($item, $old_ssje);
$this->send_refund($item, $old_ssje, $handpick);
// $this->Alipay_note_model->update_send($item->ALI_dealId, 'send');
continue;
}
@ -388,7 +388,7 @@ class AlipayTradeService extends CI_Controller
//根据订单号查找外联信息
$orderid_info = json_decode($orderid_info);
$advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
$advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick);
//查不到订单信息
if (empty($advisor_info)) {
@ -531,7 +531,7 @@ class AlipayTradeService extends CI_Controller
* @date 2019-05-09
* * TODO 线下收款之后产生的退款没有通知
*/
public function send_refund($item, $old_ssje=null)
public function send_refund($item, $old_ssje=null, $handpick)
{
// raw
$raw = json_decode($item->ALI_memo);
@ -554,7 +554,7 @@ class AlipayTradeService extends CI_Controller
$orderid_info = analysis_orderid($parent_note->ALI_orderId);
$orderid_info = json_decode($orderid_info);
//根据订单号查找外联信息
$advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
$advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick);
//查不到订单信息
if (empty($advisor_info)) {
$this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail');
@ -1097,7 +1097,7 @@ class AlipayTradeService extends CI_Controller
$neworder_id = analysis_orderid($pn_invoice);
$neworder_id = json_decode($neworder_id);
if ( ! empty($neworder_id)) {
$data['order_info'] = $this->Alipay_model->get_order($neworder_id->orderid, true, $neworder_id->ordertype);
$data['order_info'] = $this->Alipay_model->get_order($neworder_id->orderid, true, $neworder_id->ordertype, true);
}
}
$data["paytext"] = $this->payment_status();
@ -1117,7 +1117,7 @@ class AlipayTradeService extends CI_Controller
}
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
$data['order_info'] = $this->Alipay_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype);
$data['order_info'] = $this->Alipay_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype, true);
}
$data["paytext"] = $this->payment_status();
echo json_encode($this->load->view('alipay_note_setting', $data, true));
@ -1178,7 +1178,7 @@ class AlipayTradeService extends CI_Controller
$orderid_info = analysis_orderid($pn_invoice);
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
$advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
$advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, true);
if (!empty($advisor_info)) {
$this->Alipay_note_model->set_invoice($pn_txn_id, $pn_invoice);
$this->send_alipay($pn_txn_id, $old_ssje);

@ -428,7 +428,7 @@ class PaymentService extends CI_Controller {
$orderid_info = analysis_orderid($pn_invoice);
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
$data['order_info'] = $this->account_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype);
$data['order_info'] = $this->account_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype, true);
if ($orderid_info->ordertype === 'T') {
$data['gai_info'] = $this->account_model->get_money_t($pn_txn_id);
} elseif ($orderid_info->ordertype === 'B' || $orderid_info->ordertype === 'TP'
@ -443,7 +443,7 @@ class PaymentService extends CI_Controller {
$neworder_id = analysis_orderid($neworder);
$neworder_id = json_decode($neworder_id);
if ( ! empty($neworder_id)) {
$data['order_info'] = $this->account_model->get_order($neworder_id->orderid, true, $neworder_id->ordertype);
$data['order_info'] = $this->account_model->get_order($neworder_id->orderid, true, $neworder_id->ordertype, true);
}
}
echo json_encode($this->load->view('payment_gai_setting', $data, true));
@ -483,7 +483,7 @@ class PaymentService extends CI_Controller {
$orderid_info = analysis_orderid($neworder);
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
$advisor_info = $this->account_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
$advisor_info = $this->account_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, true);
if (!empty($advisor_info)) {
$this->note_model->set_invoice($data['note']->OPN_SN, $neworder);
$this->send_notify($data['note']->OPN_SN, $old_ssje);

@ -385,6 +385,7 @@ class IPayLinksService extends CI_Controller
$data['unsend_list'] = $this->Note_model->failnote(20);
}
$handpick = empty($pn_txn_id) ? false : true;
$show_index = 0;
foreach ($data['unsend_list'] as $item) {
@ -395,7 +396,7 @@ class IPayLinksService extends CI_Controller
//退款状态默认为已经处理,陆燕在退款前手动通知外联了,系统跳过处理
if ($item->IPL_payType == 'refund') {
$this->send_refund($item, $old_ssje);
$this->send_refund($item, $old_ssje, $handpick);
// $this->Note_model->update_send($item->IPL_dealId, 'send');
continue;
}
@ -423,7 +424,7 @@ class IPayLinksService extends CI_Controller
//根据订单号查找外联信息
$orderid_info = json_decode($orderid_info);
$advisor_info = $this->IPayLinks_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
$advisor_info = $this->IPayLinks_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick);
//查不到订单信息
if (empty($advisor_info)) {
@ -586,7 +587,7 @@ class IPayLinksService extends CI_Controller
* @date 2019-05-08
* * TODO APP组的退款没有原始订单
*/
public function send_refund($item, $old_ssje=NULL)
public function send_refund($item, $old_ssje=NULL, $handpick)
{
if ($item->IPL_stateCode != 2) {
return false;
@ -618,7 +619,7 @@ class IPayLinksService extends CI_Controller
$orderid_info = $this->analysis_orderid($parent_note->IPL_orderId);
$orderid_info = json_decode($orderid_info);
//根据订单号查找外联信息
$advisor_info = $this->IPayLinks_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
$advisor_info = $this->IPayLinks_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype, $handpick);
//查不到订单信息
if (empty($advisor_info)) {
$this->Note_model->update_send($item->IPL_dealId, 'sendfail');
@ -1186,7 +1187,7 @@ class IPayLinksService extends CI_Controller
$neworder_id = $this->analysis_orderid($neworder);
$neworder_id = json_decode($neworder_id);
if ( ! empty($neworder_id)) {
$data['order_info'] = $this->IPayLinks_model->get_order($neworder_id->orderid, true, $neworder_id->ordertype);
$data['order_info'] = $this->IPayLinks_model->get_order($neworder_id->orderid, true, $neworder_id->ordertype, true);
}
}
echo json_encode($this->load->view('gai_setting', $data, true));
@ -1229,7 +1230,7 @@ class IPayLinksService extends CI_Controller
$orderid_info = $this->analysis_orderid($neworder);
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
$advisor_info = $this->IPayLinks_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
$advisor_info = $this->IPayLinks_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->batch_send_note($pn_txn_id, $old_ssje, $pn_id);
@ -1270,7 +1271,7 @@ class IPayLinksService extends CI_Controller
}
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
$data['order_info'] = $this->IPayLinks_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype);
$data['order_info'] = $this->IPayLinks_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype, true);
}
$data["paytext"] = $this->payment_status();
echo json_encode($this->load->view('note_setting', $data, true));
@ -1293,7 +1294,7 @@ class IPayLinksService extends CI_Controller
}
if (!empty($orderid_info)) {
$orderid_info = json_decode($orderid_info);
$data['order_info'] = $this->IPayLinks_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype);
$data['order_info'] = $this->IPayLinks_model->get_order($orderid_info->orderid, true, $orderid_info->ordertype, true);
}
$data["paytext"] = $this->payment_status();
echo json_encode($this->load->view('note_setting', $data, true));

@ -13,14 +13,14 @@ class Alipay_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
if ($ordertype == 'B' || $ordertype == 'A') {
$sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,COLI_GRI_SN,OPI_Email,OPI_FirstName,OPI_SN,OPI_Name,COLI_WebCode,COLI_Department,COLI_PayManner,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_ID =? "; // and COLI_State<>50
where COLI_ID =? order by CHARINDEX('50',COLI_State) asc"; // and COLI_State<>50
$query = $this->HT->query($sql, array($COLI_ID));
$result = $query->result();
}
@ -62,7 +62,7 @@ class Alipay_model extends CI_Model {
if (empty($result) && $ordertype == 'B') {
$sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,COLI_GRI_SN,OPI_SN,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_GroupCode like '%-$COLI_ID%' and COLI_State<>50";
where COLI_GroupCode like '%-$COLI_ID%' order by CHARINDEX('50',COLI_State) asc";
$query = $this->HT->query($sql);
$result = $query->result();
}
@ -71,7 +71,7 @@ class Alipay_model extends CI_Model {
if (!empty($result) && is_array($result) ) {
//print_r($result[0]);
//die();
if (count($result) > 1) {
if (count($result) > 1 && $handpick===false) {
$result = array();
} else {
$result = $result[0];

@ -13,14 +13,14 @@ class IPayLinks_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
if ($ordertype == 'B' || $ordertype == 'A') {
$sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,COLI_GRI_SN,OPI_SN,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode, COLI_Department,COLI_PayManner,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_ID =? ";// and COLI_State<>50
where COLI_ID =? order by CHARINDEX('50',COLI_State) asc";// and COLI_State<>50
$query = $this->HT->query($sql, array($COLI_ID));
$result = $query->result();
}
@ -28,7 +28,7 @@ class IPayLinks_model extends CI_Model {
if (empty($result) && ($ordertype == 'T')) {
$sql = "SELECT TOP 2 1 as order_type, COLI_SN,COLI_ID,COLI_GRI_SN,OPI_SN,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' ";
$query = $this->HT->query($sql);
$result = $query->result();
}
@ -62,7 +62,7 @@ class IPayLinks_model extends CI_Model {
if (empty($result) && $ordertype == 'B') {
$sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,COLI_GRI_SN,OPI_SN,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_GroupCode like '%-$COLI_ID%' and COLI_State<>50";
where COLI_GroupCode like '%-$COLI_ID%' order by CHARINDEX('50',COLI_State) asc";
$query = $this->HT->query($sql);
$result = $query->result();
}
@ -71,13 +71,12 @@ class IPayLinks_model extends CI_Model {
if (!empty($result) && is_array($result) ) {
//print_r($result[0]);
//die();
if (count($result) > 1) {
if (count($result) > 1 && $handpick===false) {
$result = array(); // 找到多条匹配的订单记录时,不处理
} else {
$result = $result[0];
}
}
return $result;
}

@ -32,7 +32,7 @@ class Online_payment_account_model extends CI_Model {
if ($ordertype == 'B' || $ordertype == 'A' || $ordertype == 'TP') {
$sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_PayManner,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_ID =? "; // and COLI_State<>50
where COLI_ID =? order by CHARINDEX('50',COLI_State) asc"; // and COLI_State<>50
$query = $this->HT->query($sql, array($COLI_ID));
$result = $query->result();
}
@ -78,7 +78,7 @@ class Online_payment_account_model extends CI_Model {
if (empty($result) && $ordertype == 'B') {
$sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_GroupCode like '%-$COLI_ID%' and COLI_State<>50";
where COLI_GroupCode like '%-$COLI_ID%' order by CHARINDEX('50',COLI_State) asc";
$query = $this->HT->query($sql);
$result = $query->result();
}
@ -87,7 +87,7 @@ class Online_payment_account_model extends CI_Model {
if (!empty($result) && is_array($result) ) {
//print_r($result[0]);
//die();
if (count($result) > 1) {
if (count($result) > 1 && $handpick===false) {
$result = array();
} else {
$result = $result[0];

@ -21,7 +21,7 @@ class Paypal_model extends CI_Model {
if ($ordertype == 'B' || $ordertype == 'A') {
$sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,COLI_GRI_SN,OPI_Email,OPI_FirstName,OPI_SN,OPI_Name,COLI_WebCode,COLI_Department,COLI_PayManner,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_ID =? "; // and COLI_State<>50
where COLI_ID =? order by CHARINDEX('50',COLI_State) asc"; // and COLI_State<>50
$query = $this->HT->query($sql, array($COLI_ID));
$result = $query->result();
}
@ -67,7 +67,7 @@ class Paypal_model extends CI_Model {
if (empty($result) && $ordertype == 'B') {
$sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,COLI_GRI_SN,OPI_SN,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_Department,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_GroupCode like '%-$COLI_ID%' and COLI_State<>50";
where COLI_GroupCode like '%-$COLI_ID%' order by CHARINDEX('50',COLI_State) asc";
$query = $this->HT->query($sql);
$result = $query->result();
}
@ -76,7 +76,7 @@ class Paypal_model extends CI_Model {
if (!empty($result) && is_array($result) ) {
//print_r($result[0]);
//die();
if (count($result) > 1) {
if (count($result) > 1 && $handpick===false) {
$result = array();
} else {
$result = $result[0];

Loading…
Cancel
Save