From a602a2a3a454940162744efc1dca74967593d2e2 Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 12 Mar 2020 09:19:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=A3=E6=9E=90=E5=BD=95=E5=85=A5iPa?= =?UTF-8?q?ylinks=E5=AF=B9=E8=B4=A6=E5=8D=95=E5=88=B0OPN;=20=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=88=97=E8=A1=A8=E6=94=AF=E6=8C=81=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webht/config/database.php | 2 +- .../pay/controllers/PaymentService.php | 62 +++---- .../pay/libraries/ipaylinks_call.php | 156 +++++++++++++++--- .../models/Online_payment_account_model.php | 42 ++++- .../pay/models/Online_payment_note_model.php | 76 +++++++-- webht/third_party/pay/views/payment_list.php | 17 +- 6 files changed, 272 insertions(+), 83 deletions(-) diff --git a/webht/config/database.php b/webht/config/database.php index 3a7d8aae..564717fb 100644 --- a/webht/config/database.php +++ b/webht/config/database.php @@ -45,4 +45,4 @@ require 'C:/database_conn.php'; /* End of file database.php */ -/* Location: ./application/config/database.php */ \ No newline at end of file +/* Location: ./application/config/database.php */ diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php index d70daaba..c1d31f05 100644 --- a/webht/third_party/pay/controllers/PaymentService.php +++ b/webht/third_party/pay/controllers/PaymentService.php @@ -16,23 +16,39 @@ class PaymentService extends CI_Controller { $this->load->model('Online_payment_account_model', 'account_model'); } + private $code_brandname = array( + "15002" => "PayPal", + "15010" => "PayPal", + "15015" => "Alipay", + "15016" => "WeChat", + "15018" => "Credit Card", + ); + public function index() { } - public function note_list() + public function note_list($method=null) { $this->permission->is_admin(true); $data = array(); + $data['method_code'] = ''; // $data["paytext"] = $this->payment_status(); - $data["method_name"] = $this->input->get_post("method_name"); + if (isset($this->code_brandname[$method])) { + $data['method_code'] = $method; + $data["method_name"] = $this->code_brandname[$method]; + } $data["keywords"] = $this->input->get_post("keywords"); $data["date"] = $this->input->get_post("date"); empty($data['date']) ? $data['date'] = date('Y-m-d') : false; if (!empty($data['keywords'])) { $data['notelist'] = $this->note_model->search_key($data['keywords']); } else { - $data['notelist'] = $this->note_model->search_date($data['date']); + $search_date = $this->note_model->search_date($data['date'], $method); + $unsend = $this->note_model->unsend_note(false, $method); + $sendfail = $this->note_model->sendfail_note(false, $method); + $closed = $this->note_model->closed_note($data['date'], 300, $method); + $data['notelist'] = array_merge(array_merge($unsend, $sendfail), array_merge($search_date, $closed)); } array_walk($data["notelist"], 'PaymentService::set_brandname'); @@ -51,7 +67,7 @@ class PaymentService extends CI_Controller { $this->permission->is_admin(true); $data = array(); $data['date'] = date('Y-m-d'); - $data['notelist'] = $this->note_model->failnote(100); + $data['notelist'] = $this->note_model->sendfail_note(false); array_walk($data["notelist"], 'PaymentService::set_brandname'); $this->load->view("payment_list",$data); return; @@ -60,22 +76,8 @@ class PaymentService extends CI_Controller { public function set_brandname(&$ele) { $ele->brand_name = "none"; - switch ($ele->OPN_accountMethod) { - case '15016': - $ele->brand_name = "WeChat"; - break; - case '15010': - case '15002': - $ele->brand_name = "PayPal"; - break; - case '15018': - $ele->brand_name = "Credit Card"; - break; - case '15015': - $ele->brand_name = "Alipay"; - break; - default: - break; + if ($this->code_brandname[$ele->OPN_accountMethod]) { + $ele->brand_name = $this->code_brandname[$ele->OPN_accountMethod]; } } @@ -623,8 +625,6 @@ class PaymentService extends CI_Controller { echo "none excel."; return; } - $settle_cnt = 0; - $insert_cnt = 0; $file_path_output = ""; foreach ($files as $k => $fe) { if ( ! in_array(strrchr($fe, '.'), array(".xlsx", ".xls"))) { @@ -637,18 +637,18 @@ class PaymentService extends CI_Controller { if ( ! file_exists($file_path)) { continue; } - if ($fun_version==='old') { + if ($target_file==='2019-09') { // 2019.09.10 切换清算账单, 此处特殊处理 + $settlement_record = $this->ipaylinks_call->read_excel_old($file_path); + $update_cnt = $this->ipaylinks_call->save_excel_old($settlement_record); + $settlement_record2 = $this->ipaylinks_call->read_excel_new($file_path,1); + $update_cnt2 = $this->ipaylinks_call->save_excel_new($settlement_record2); + $update_cnt += $update_cnt2; + } else if ($fun_version==='old') { $settlement_record = $this->ipaylinks_call->read_excel_old($file_path); - } else { - $settlement_record = $this->ipaylinks_call->read_excel_new($file_path); - } - if (empty($settlement_record)) { - continue; - } - if ($fun_version==='old') { $update_cnt = $this->ipaylinks_call->save_excel_old($settlement_record); } else { - // $update_cnt = $this->ipaylinks_call->read_excel_new($file_path); + $settlement_record = $this->ipaylinks_call->read_excel_new($file_path); + $update_cnt = $this->ipaylinks_call->save_excel_new($settlement_record); } $file_path_output .= "\r\n" . $file_path; if ($k > 0) { diff --git a/webht/third_party/pay/libraries/ipaylinks_call.php b/webht/third_party/pay/libraries/ipaylinks_call.php index a6c98c89..3382cf4f 100644 --- a/webht/third_party/pay/libraries/ipaylinks_call.php +++ b/webht/third_party/pay/libraries/ipaylinks_call.php @@ -18,9 +18,17 @@ class Ipaylinks_call public function save_excel_old($excel_data) { $settle_cnt = 0; - foreach ($excel_data as $settle) { + foreach ($excel_data as $key => $settle) { + // test: + // $note_exists = $this->ci->note_model->if_note_exists($settle['transaction_id'], $settle['orderid']); + // if (true === $note_exists) { + // continue; + // } $save_column = array(); $save_column['OPN_accountMethod'] = $this->ci->config->item('method_code', 'ipaylinks'); + $save_column['OPN_invoiceId'] = $settle['orderid']; + $save_column['OPN_orderId'] = $settle['orderid']; + $save_column['OPN_orderAmount'] = $settle['order_amount']; if ($settle['data_type'] == '已清算退款' || $settle['data_type'] == '未清算退款') { // 退款 // $ssje = $this->account_model->get_ssje($row['settlement_refund_fee'], str_replace("CNY", "RMB", strtoupper($row['currency_type'])), $save_column['OPN_accountMethod']); @@ -28,38 +36,68 @@ class Ipaylinks_call // $save_column['OPN_resultMsg'] = $row['refund_status']; // $save_column['OPN_entryAmountCNY'] = floatval("-" . $ssje); $save_column['OPN_noticeType'] = 'refund'; - // $save_column['OPN_relatedId'] = $row['transaction_id']; + $save_column['OPN_relatedId'] = $settle['transaction_id']; + $save_column['OPN_transactionId'] = ''; + if (true === $this->ci->note_model->if_refund_exists($settle['orderid'])) { + continue; + } + $query_from_ipalinkslog = $this->ci->note_model->query_ipalinkslog_memo($settle['orderid']); + if ( ! empty($query_from_ipalinkslog)) { + $save_column['OPN_transactionId'] = $query_from_ipalinkslog->IPL_dealId; + $save_column['OPN_invoiceId'] = $query_from_ipalinkslog->IPL_orderId; + $save_column['OPN_orderId'] = $query_from_ipalinkslog->IPL_orderId; + } + $related = $this->ci->note_model->query_related($save_column['OPN_relatedId']); + if ( ! empty($related)) { + $save_column['OPN_orderId'] = $related[0]->OPN_orderId; + $save_column['OPN_accountType'] = $related[0]->OPN_accountType; + } } elseif ($settle['data_type'] == '清算') { // 收款 - // $ssje = $this->account_model->get_ssje($row['settlement_total_fee'], str_replace("CNY", "RMB", strtoupper($row['currency_type'])), $save_column['OPN_accountMethod']); - // $save_column['OPN_resultCode'] = $settle['trade_state']; - // $save_column['OPN_resultMsg'] = $settle['trade_state']; - // $save_column['OPN_entryAmountCNY'] = floatval($ssje); $save_column['OPN_noticeType'] = 'pay'; - // $save_column['OPN_relatedId'] = ''; + $save_column['OPN_transactionId'] = $settle['transaction_id']; + + $note_exists = $this->ci->note_model->if_note_exists($settle['transaction_id'], $settle['orderid']); + if (true === $note_exists) { + continue; // test: + } } else { continue; } - $save_column['OPN_transactionId'] = $settle['transaction_id']; - $save_column['OPN_orderAmount'] = $settle['order_amount']; + if ($save_column['OPN_transactionId']==='') { + continue; + } + // test: 月账单太长 + if ($settle_cnt > 999) { + break; + } + $order_info = $this->ci->account_model + ->get_gai( + $save_column['OPN_transactionId'], + $save_column['OPN_orderId'], + $save_column['OPN_orderAmount'], + $save_column['OPN_accountMethod'] + ); + if ($order_info['data'] !== null) { + $save_column['OPN_orderId'] = $order_info['data']->orderId; + $save_column['OPN_accountType'] = $order_info['type']; + $save_column['OPN_accountStatus'] = 'recorded'; + } $save_column['OPN_payAmount'] = $settle['order_amount']; - $save_column['OPN_noticeSendStatus'] = 'unsend'; + $save_column['OPN_noticeSendStatus'] = 'closed'; $save_column['OPN_transactionResult'] = 'completed'; - $save_column['OPN_orderId'] = $settle['orderid']; $save_column['OPN_rawOrderId'] = $settle['orderid']; - $save_column['OPN_invoiceId'] = $settle['orderid']; - // $save_column['OPN_subject'] = $settle['item_name']; $save_column['OPN_currency'] = $settle['currency']; $save_column['OPN_acquiringTime'] = date('Y-m-d H:i:s',strtotime($settle['complete_date'])); $save_column['OPN_completeTime'] = date('Y-m-d H:i:s',strtotime($settle['complete_date'])); $save_column['OPN_remark'] = $settle['mark_memo']; - // $save_column['OPN_payerLogId'] = $settle['openid']; $save_column['OPN_fundSource'] = 'cht'; - $save_column['OPN_rawContent'] = json_encode($settle); + $save_column['OPN_rawContent'] = json_encode($settle, JSON_UNESCAPED_UNICODE); $save_column['OPN_noticeTime'] = date('Y-m-d H:i:s'); $note_exists = $this->ci->note_model->if_note_exists($settle['transaction_id'], $settle['orderid']); if (true === $note_exists) { + continue; // test: // update $update_where = " OPN_transactionId='" . $settle['transaction_id'] . "' AND OPN_rawOrderId='" . $settle['orderid'] . "' "; $this->ci->note_model->update_note($update_where, $save_column) ; @@ -72,7 +110,7 @@ class Ipaylinks_call } return $settle_cnt; } - public function read_excel_old($filePath) + public function read_excel_old($filePath, $sheetIndex=0) { $tarr1=array(); $this->ci->load->library('PHPExcel'); @@ -88,13 +126,15 @@ class Ipaylinks_call } $PHPExcel = $PHPReader->load($filePath); /**读取excel文件中的第一个工作表*/ - $currentSheet = $PHPExcel->getSheet(0); + $currentSheet = $PHPExcel->getSheet($sheetIndex); /**取得最大的列号*/ $allColumn = $currentSheet->getHighestColumn(); /**取得一共有多少行*/ $allRow = $currentSheet->getHighestRow(); + log_message('error','all row ' . $allRow); + $realRow = 0; $col_titles = $this->excel_title_old(); /**从第二行开始输出,因为excel表中第一行为列名*/ for($currentRow = 2;$currentRow <= $allRow;$currentRow++){ @@ -115,8 +155,10 @@ class Ipaylinks_call } if (isset($row_tmp['settlement_amount'])) { $tarr1[] = $row_tmp; + $realRow++; } } + log_message('error','real row ' . $realRow); return $tarr1; } private function no_store_deal_type() @@ -152,10 +194,67 @@ class Ipaylinks_call ); } - public function read_excel_new($filePath) + public function save_excel_new($excel_data) + { + $settle_cnt = 0; + foreach ($excel_data as $settle) { + $save_column = array(); + $save_column['OPN_accountMethod'] = $this->ci->config->item('method_code', 'ipaylinks'); + $save_column['OPN_noticeType'] = trim($settle['trade_type']) === '消费' ? 'pay' : 'refund'; + $save_column['OPN_fundSource'] = trim($settle['site_id']) === 'www.chinahighlights.com' ? 'cht' : 'app'; + + $save_column['OPN_transactionId'] = $settle['transaction_id']; + $save_column['OPN_relatedId'] = str_ireplace("-", '', $settle['related_id']); + + $save_column['OPN_orderAmount'] = $settle['trade_amount']; + $save_column['OPN_orderId'] = $settle['orderid']; + $note_exists = $this->ci->note_model->if_note_exists($settle['transaction_id'], $settle['orderid']); + if (true === $note_exists) { + continue; // test: + } + $order_info = $this->ci->account_model + ->get_gai( + $save_column['OPN_transactionId'], + $save_column['OPN_orderId'], + $save_column['OPN_orderAmount'], + $save_column['OPN_accountMethod'] + ); + if ($order_info['data'] !== null) { + $save_column['OPN_orderId'] = $order_info['data']->orderId; + $save_column['OPN_accountType'] = $order_info['type']; + $save_column['OPN_accountStatus'] = 'recorded'; + } + $save_column['OPN_payAmount'] = $settle['trade_amount']; + $save_column['OPN_noticeSendStatus'] = 'closed'; + $save_column['OPN_transactionResult'] = 'completed'; + $save_column['OPN_rawOrderId'] = $settle['orderid']; + $save_column['OPN_invoiceId'] = $settle['orderid']; + $save_column['OPN_currency'] = $settle['trade_currency']; + $save_column['OPN_acquiringTime'] = date('Y-m-d H:i:s',strtotime($settle['complete_date'])); + $save_column['OPN_completeTime'] = date('Y-m-d H:i:s',strtotime($settle['complete_date'])); + $save_column['OPN_remark'] = str_ireplace("-", '', $settle['apply_pay_type']) . "_" . str_ireplace("-", '', $settle['trade_region']) . "_" . str_ireplace("-", '', $settle['card_issuers']) . "_" . str_ireplace("-", '', $settle['card_bin_country']) . "_" . str_ireplace("-", '', $settle['card_type']); + $save_column['OPN_rawContent'] = json_encode($settle, JSON_UNESCAPED_UNICODE); + $save_column['OPN_noticeTime'] = date('Y-m-d H:i:s'); + + $note_exists = $this->ci->note_model->if_note_exists($settle['transaction_id'], $settle['orderid']); + if (true === $note_exists) { + // update + $update_where = " OPN_transactionId='" . $settle['transaction_id'] . "' AND OPN_rawOrderId='" . $settle['orderid'] . "' "; + $this->ci->note_model->update_note($update_where, $save_column) ; + $settle_cnt++; + } elseif (false === $note_exists) { + // insert + $this->ci->note_model->insert_note($save_column) ; + $settle_cnt++; + } + } + return $settle_cnt; + } + + public function read_excel_new($filePath, $sheetIndex=0) { $tarr1=array(); - $this->load->library('PHPExcel'); + $this->ci->load->library('PHPExcel'); $PHPExcel = new PHPExcel(); /**默认用excel2007读取excel,若格式不对,则用之前的版本进行读取*/ $PHPReader = new PHPExcel_Reader_Excel2007(); @@ -168,23 +267,34 @@ class Ipaylinks_call } $PHPExcel = $PHPReader->load($filePath); /**读取excel文件中的第一个工作表*/ - $currentSheet = $PHPExcel->getSheet(0); + $currentSheet = $PHPExcel->getSheet($sheetIndex); /**取得最大的列号*/ $allColumn = $currentSheet->getHighestColumn(); - /**取得一共有多少行*/ $allRow = $currentSheet->getHighestRow(); + + log_message('error','all row ' . $allRow); + $col_titles = $this->excel_title_new(); /**从第二行开始输出,因为excel表中第一行为列名*/ for($currentRow = 2;$currentRow <= $allRow;$currentRow++){ $row_tmp = array(); /**从第A列开始输出*/ - for($currentColumn= 'A';$currentColumn<= "AD"; $currentColumn++){ + $columnNum = 0; + // for($currentColumn= 'A';$currentColumn<= "AD"; $currentColumn++){ + // 列标题Z之后的不能直接用逻辑运算 + for($currentColumn= 'A';str_pad($currentColumn, 2, "0", STR_PAD_LEFT)<= $allColumn; $currentColumn++){ /**ord()将字符转为十进制数*/ - $val = trim($currentSheet->getCellByColumnAndRow(ord($currentColumn) - 65,$currentRow)->getValue()); + // $val = trim($currentSheet->getCellByColumnAndRow(ord($currentColumn) - 65,$currentRow)->getValue()); + // 列标题Z之后不能直接用ord计算ASCII码,因ord仅返回第一个字符的结果导致列AA的值读取到列A + $val = trim($currentSheet->getCellByColumnAndRow($columnNum,$currentRow)->getValue()); + if ( ! isset($col_titles[$currentColumn])) { + continue; + } $col_mean = $col_titles[$currentColumn]; $row_tmp[$col_mean] = trim($val)==='-' ? '' : $val; + $columnNum++; } $tarr1[] = $row_tmp; } 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 272f441a..5db785f8 100644 --- a/webht/third_party/pay/models/Online_payment_account_model.php +++ b/webht/third_party/pay/models/Online_payment_account_model.php @@ -164,24 +164,50 @@ class Online_payment_account_model extends CI_Model { return $query; } + public function get_gai($t_id, $order=null, $amount=null, $type=null) + { + $ret = array("type"=> null, "data"=>null); + $result_t = $this->get_money_t($t_id); + $result_b = $this->get_money_b($t_id, $order, $amount, $type); + if ( ! empty($result_t)) { + $ret['type'] = 'T'; + $ret['data'] = $result_t[0]; + } else if ( ! empty($result_b)) { + $ret['type'] = 'B'; + $ret['data'] = $result_b[0]; + } + return $ret; + } + //根据交易号获取收款记录(传统订单) public function get_money_t($pn_invoice) { - $sql = "SELECT GroupAccountInfo.* - from GroupAccountInfo - where DeleteFlag=0 and GAI_AccreditNo=? + $sql = "SELECT COLI_ID orderId, g.* + from GroupAccountInfo g + inner join Tourmanager.dbo.ConfirmLineInfo on g.GAI_COLI_SN=COLI_SN + where g.DeleteFlag=0 and g.GAI_AccreditNo=? "; $query = $this->HT->query($sql, array($pn_invoice)); $result = $query->result(); return $result; } //根据交易号获取收款记录(商务订单) - public function get_money_b($pn_invoice) { - $sql = "SELECT BIZ_GroupAccountInfo.* - from BIZ_GroupAccountInfo - where DeleteFlag=0 and GAI_AccreditNo=? + public function get_money_b($t_id, $raw_order=null, $amount=null, $payment_type=null) { + $sql = "SELECT COLI_ID orderId, g.* + from BIZ_GroupAccountInfo g + inner join Tourmanager.dbo.BIZ_ConfirmLineInfo on g.GAI_COLI_SN=COLI_SN + where g.DeleteFlag=0 and g.GAI_AccreditNo=? "; - $query = $this->HT->query($sql, array($pn_invoice)); + $query = $this->HT->query($sql, array($t_id)); $result = $query->result(); + if (empty($result)) { + $raw_order_sql = "SELECT COLI_ID orderId, g.* + from BIZ_GroupAccountInfo g + inner join Tourmanager.dbo.BIZ_ConfirmLineInfo on g.GAI_COLI_SN=COLI_SN + where g.DeleteFlag=0 and COLI_ID=? and g.GAI_SQJE=? and g.GAI_Type=? + "; + $query = $this->HT->query($raw_order_sql, array($raw_order, $amount, $payment_type)); + $result = $query->result(); + } return $result; } /** 删除收款记录 */ diff --git a/webht/third_party/pay/models/Online_payment_note_model.php b/webht/third_party/pay/models/Online_payment_note_model.php index d3528c29..6ccbed7f 100644 --- a/webht/third_party/pay/models/Online_payment_note_model.php +++ b/webht/third_party/pay/models/Online_payment_note_model.php @@ -18,6 +18,15 @@ class Online_payment_note_model extends CI_Model { return $this->info->query($ret, array($transaction_id))->num_rows() > 0; } + public function if_refund_exists($refund_id) + { + if ($refund_id === null) { + return null; + } + $ret = "SELECT TOP 1 * FROM OnlinePaymentNote WHERE OPN_rawOrderId=? ORDER BY OPN_SN DESC "; + return $this->info->query($ret, array($refund_id))->num_rows() > 0; + } + public function insert_note($column) { if ($column === null) { @@ -50,18 +59,32 @@ class Online_payment_note_model extends CI_Model { return $this->update_note($where, $column); } - public function unsend_note($num=2) + public function unsend_note($num=2, $method=null) { $this->init_query(); $this->topnum = $num; - $this->send = " AND (OPN_noticeSendStatus='unsend' OR OPN_noticeSendStatus='' OR OPN_noticeSendStatus IS NULL) "; + // $this->send = " AND (OPN_noticeSendStatus='unsend' OR OPN_noticeSendStatus='' OR OPN_noticeSendStatus IS NULL) "; + $this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; + + $this->send = " AND ISNULL(OPN_noticeSendStatus,'') in ('', 'unsend') "; return $this->query_note(); } - public function sendfail_note($num=2) + public function closed_note($date, $num=2, $method=null) { $this->init_query(); $this->topnum = $num; + $this->send = " AND (OPN_noticeSendStatus) = 'closed' "; + $this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; + $this->search .= " AND OPN_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59' "; + return $this->query_note(); + } + + public function sendfail_note($num=2, $method=null) + { + $this->init_query(); + $this->topnum = $num; + $this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; $this->send = " AND OPN_noticeSendStatus='sendfail' "; return $this->query_note(); } @@ -98,6 +121,9 @@ class Online_payment_note_model extends CI_Model { $this->search ? $sql.=$this->search : false; $this->transactionId ? $sql.=$this->transactionId : false; $this->orderby ? $sql.=$this->orderby : false; + + // log_message('error', PHP_EOL . $sql); + $query = $this->info->query($sql); return $query->result(); } @@ -125,17 +151,12 @@ class Online_payment_note_model extends CI_Model { return $this->query_note(); } - public function search_date($date) + public function search_date($date, $method=null) { $this->init_query(); - $this->search = " AND OPN_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59' "; - return $this->query_note(); - } - - public function failnote($topnum = 2) { - $this->init_query(); - $this->topnum = $topnum; - $this->send = " AND OPN_noticeSendStatus='sendfail' "; + $this->search = $method===null ? "" : " AND OPN_accountMethod=$method "; + $this->search .= " AND OPN_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59' "; + $this->send = " AND isnull(OPN_noticeSendStatus,'') NOT IN ('', 'sendfail', 'unsend', 'closed' )"; return $this->query_note(); } @@ -148,13 +169,36 @@ class Online_payment_note_model extends CI_Model { { $search_sql = $sn===0 ? "" : " and TEL_SN=$sn "; $sql = "SELECT TOP 10 * - FROM [InfoManager].[dbo].[Transaction_Export_Log] - WHERE 1=1 - $search_sql - order by TEL_SN desc"; + FROM [InfoManager].[dbo].[Transaction_Export_Log] + WHERE 1=1 + $search_sql + order by TEL_SN desc"; return $this->info->query($sql)->result(); } + public function query_ipalinkslog_memo($memo) + { + $sql = "SELECT * + from IPayLinksLog + where CHARINDEX(?,IPL_memo)>0"; + return $this->info->query($sql, array($memo))->row(); + } + + public function query_ipalinkslog_dealid($id) + { + $sql = "SELECT * + from IPayLinksLog + where IPL_dealId=?"; + return $this->info->query($sql, array($id))->row(); + } + + public function query_related($related_id) + { + $this->init_query(); + $this->search = " AND OPN_transactionId='$related_id' and OPN_accountType is not null "; + return $this->query_note(); + } + } diff --git a/webht/third_party/pay/views/payment_list.php b/webht/third_party/pay/views/payment_list.php index 7116d96b..c7ad4bb9 100644 --- a/webht/third_party/pay/views/payment_list.php +++ b/webht/third_party/pay/views/payment_list.php @@ -125,13 +125,22 @@

Payment List

- 微信 + ALL   - PayPal» + class="text-muted" + href="/webht.php/apps/pay/paymentservice/note_list/15016">微信»   - 信用卡» + + class="text-muted" + href="/webht.php/apps/pay/paymentservice/note_list/15002">PayPal»   - 支付宝» + class="text-muted" + href="/webht.php/apps/pay/paymentservice/note_list/15018">信用卡» + +   + class="text-muted" + href="/webht.php/apps/pay/paymentservice/note_list/15015">支付宝» +