From fa4f294cabd4234b22400b917b8f508f4712469c Mon Sep 17 00:00:00 2001 From: lyt Date: Thu, 9 May 2019 17:01:08 +0800 Subject: [PATCH] =?UTF-8?q?Alipay=20=E9=80=80=E6=AC=BE=E5=A4=84=E7=90=86;N?= =?UTF-8?q?ote:=20=E9=80=80=E6=AC=BE=E5=8F=B732=E4=BD=8D,=20=E8=B6=85?= =?UTF-8?q?=E8=BF=87GAI=5FAccreditNo=E7=9A=84=E9=95=BF=E5=BA=A6,=E5=BD=95?= =?UTF-8?q?=E5=85=A5=E5=92=8C=E5=88=A4=E6=96=AD=E6=97=B6=E6=88=AA=E5=8F=96?= =?UTF-8?q?,=20=E5=A4=87=E6=B3=A8=E5=AE=8C=E6=95=B4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/AlipayTradeService.php | 209 +++++++++++++++++- webht/third_party/pay/models/Alipay_model.php | 63 +++++- webht/third_party/pay/views/alipay_list.php | 4 +- .../pay/views/alipay_note_setting.php | 2 +- 4 files changed, 256 insertions(+), 22 deletions(-) diff --git a/webht/third_party/pay/controllers/AlipayTradeService.php b/webht/third_party/pay/controllers/AlipayTradeService.php index cf9dce05..07a44c19 100644 --- a/webht/third_party/pay/controllers/AlipayTradeService.php +++ b/webht/third_party/pay/controllers/AlipayTradeService.php @@ -358,7 +358,8 @@ class AlipayTradeService extends CI_Controller //退款状态默认为已经处理,陆燕在退款前手动通知外联了,系统跳过处理 if ($item->ALI_payType == 'refund') { - $this->Alipay_note_model->update_send($item->ALI_dealId, 'send'); + $this->send_refund($item); + // $this->Alipay_note_model->update_send($item->ALI_dealId, 'send'); continue; } @@ -415,7 +416,7 @@ class AlipayTradeService extends CI_Controller $ht_memo = '交易号(自动录入):' . $item->ALI_dealId; $GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0; //CHTAPP订单添加记录前判断是否有记录,以前的APP版本没有交易号,只能拿金额来判断 - if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP') { + if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") != '-biz') { //只判断前6位字符,CHTAPP-fr CHTAPP-jp等各语种都属于APP订单 $this->Alipay_model->add_account_info_forAPP( $GAI_COLI_SN, @@ -521,6 +522,191 @@ class AlipayTradeService extends CI_Controller return; } + /*! + * 退款处理 + * @date 2019-05-09 + * * TODO 线下收款之后产生的退款没有通知 + */ + public function send_refund($item) + { + // raw + $raw = json_decode($item->ALI_memo); + $parent_order = $raw->out_trade_no; + $parent_trade_no = $raw->trade_no; + $parent_note = $this->Alipay_note_model->note($parent_trade_no); + // APP 组的退款查不到原始收款记录 todo + if (empty($parent_note) ) { # && true === $this->Alipay_note_model->if_APP_order($parent_order) ) { + // $parent_note = $parent_payment; + // 补充字段 + // $parent_note->IPL_orderId = $parent_order . '_B'; + // $parent_note->IPL_currencyCode = $parent_payment->currencyCode; + // $parent_note->IPL_payerName = strval("''"); + // $parent_note->IPL_payerEmail = strval("''"); + + $this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail'); + return false; + } + //订单号 + $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); + //查不到订单信息 + if (empty($advisor_info)) { + $this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail'); + return false; + } + //更新正确的订单信息到记录中,以这个为主 + $this->Alipay_note_model->set_invoice($item->ALI_dealId, $orderid_info->orderid . '_' . $orderid_info->ordertype); + + //添加支付信息入库 + //没有分配订单之前先添加付款记录,这个过程可能会执行多次,必须在添加记录前查找是否有数据 + if ( ! empty($orderid_info)) { + $currencyCode = str_replace("CNY", "RMB", trim(mb_strtoupper($item->ALI_currencyCode))); + $currencyCode = mb_strtoupper(trim($currencyCode)); + $ssje = $this->Alipay_model->get_ssje($item->ALI_orderAmount, $currencyCode, '15015'); + $USD_amount = $this->Alipay_model->get_USD($item->ALI_orderAmount, $currencyCode); + //更新还没有填的客邮和交易号de收款记录(商务订单) + if (isset($advisor_info->order_type) && $advisor_info->order_type == 0) { + $ht_memo = '(自动)退款号:' . $item->ALI_dealId . "\n. "; + $ht_memo .= '原收款号:' . $parent_trade_no; + $GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0; + //CHTAPP订单添加记录前判断是否有记录,以前的APP版本没有交易号,只能拿金额来判断 + if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") != '-biz') {//只判断前6位字符,CHTAPP-fr CHTAPP-jp等各语种都属于APP订单 + $this->Alipay_model->add_account_info_forAPP( + $GAI_COLI_SN, + $advisor_info->COLI_ID, + $item->ALI_orderAmount, + $item->ALI_completeTime, + $currencyCode, + $ssje, + $item->ALI_completeTime, + $item->ALI_completeTime, + $item->ALI_acquiringTime, + NULL, + NULL, + $item->ALI_dealId, + $ht_memo); + $this->Alipay_model->insert_biz_order_log($GAI_COLI_SN, 'Refunded'); + } else { + if (false == $this->Alipay_model->if_biz_gai_exists($item->ALI_dealId) ) { + $this->Alipay_model->insert_biz_order_log($GAI_COLI_SN, 'Refunded'); + } + $this->Alipay_model->add_account_info( + $GAI_COLI_SN, + $advisor_info->COLI_ID, + $item->ALI_orderAmount, + $item->ALI_completeTime, + $currencyCode, + $USD_amount, + $ssje, + $item->ALI_completeTime, + $item->ALI_completeTime, + $item->ALI_acquiringTime, + NULL, + NULL, + $item->ALI_dealId, + $ht_memo); + } + } + //更新还没有填的客邮和交易号的收款记录(传统订单) + elseif (isset($advisor_info->order_type) && $advisor_info->order_type == 1) { + $ht_memo = '(自动)退款号:' . $item->ALI_dealId . "\n. "; + $ht_memo .= '原交易号:' . $parent_trade_no; + $GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0; + $gai_sn = $this->Alipay_model->add_tour_account_info( + $GAI_COLI_SN, + $item->ALI_orderAmount, + $item->ALI_completeTime, + $currencyCode, + $ssje, + $item->ALI_completeTime, + $item->ALI_completeTime, + $item->ALI_acquiringTime, + NULL, + NULL, + $item->ALI_dealId, + $ht_memo); + //添加汉特的订单提醒 + $this->Alipay_model->update_coli_introduction($GAI_COLI_SN, '已退款 ' . ($currencyCode) . $item->ALI_orderAmount); + } + } + + $opi_email = !empty($advisor_info->OPI_Email) ? $advisor_info->OPI_Email : ''; //lussie@chinahighlights.net + $opi_firstname = !empty($advisor_info->OPI_FirstName) ? $advisor_info->OPI_FirstName : !empty($advisor_info->OPI_Name) ? $advisor_info->OPI_Name : ''; //lussie + + //没有外联信息表示订单未分配 + if (empty($opi_email) || empty($opi_firstname)) { + $this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail'); + return false; + } + + //添加邮件发送记录 + // if (true) { // test + if ($item->ALI_sent !== 'send' && substr($item->ALI_sent, 0, 5) !== 'send-') { + // 客人邮件中的外联落款 + // $web_code = 'cht'; // 默认cht + $web_lgc = 1; + $web_code = strtolower($advisor_info->COLI_WebCode); + $site_info = $this->config->item('site'); + if (isset($site_info[$web_code])) { + $site_info = $site_info[$web_code]; + $item->site = $site_info['site_url']; + $web_lgc = $site_info['site_lgc']; + } + $advisor_detail = $this->Alipay_model->get_advisor_detail($advisor_info->COLI_SN, $advisor_info->OPI_SN, $web_lgc); + $item->advisor_detail = $advisor_detail; + + //给外联发送通知邮件 + $fromName = !empty($parent_note->ALI_payerName) ? $parent_note->ALI_payerName : 'Alipay'; + $fromEmail = !empty($parent_note->ALI_payerEmail) ? $parent_note->ALI_payerEmail : ''; + $toName = !empty($opi_firstname) ? $opi_firstname : ''; + $toEmail = !empty($opi_email) ? $opi_email : ''; + $subject = $orderid_info->orderid . '_' . $orderid_info->ordertype . ' / ' . $item->ALI_orderAmount . $currencyCode . ' / ' . $fromName; + $body = $this->load->view('alipay_receipt_mail', $item, true); + $M_RelatedInfo = $item->ALI_sn; + $M_AddTime = $item->ALI_completeTime; + $M_State = 0; + $this->Alipay_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'Alipay note'); + // 通知客人, 客人邮箱 + $customer_detail = $this->Alipay_model->get_customer_detail($advisor_info->COLI_SN, $orderid_info->ordertype); + $c_fromName = $advisor_detail->fullname; + $opi_email_list = explode(";", $advisor_detail->email); // 解析外联的邮件 + $c_fromEmail = trim($opi_email_list[0]); + $c_toName = $customer_detail->fullname; + $c_toEmail = $customer_detail->email; + $c_subject = $currencyCode . " " . str_replace('-', '', $item->ALI_orderAmount) . " Refunded to your account, booking number " . $item->ALI_orderId; + // 修改一些字段名, 为了和iPaylinks等用同一个邮件模板 + $item->payer = $customer_detail->fullname; + $item->payer_email = $customer_detail->email; + $item->total_amount = $item->ALI_orderAmount; + $item->payment_date = $item->ALI_completeTime; + $item->payment_status = "Refunfed"; + $item->currency = $currencyCode; + $item->invoice = $item->ALI_orderId; + $c_body = $this->load->view('refund_buyer', $item, true); + $c_M_RelatedInfo = $item->ALI_sn; + $c_M_AddTime = $item->ALI_completeTime; + $c_M_State = 0; + $this->Alipay_model->save_automail( + $c_fromName, + $c_fromEmail, + $c_toName, + $c_toEmail, + $c_subject, + $c_body, + $c_M_RelatedInfo, + $c_M_State, + $c_M_AddTime, + 'Alipay refund receipt'); + $this->Alipay_note_model->update_send($item->ALI_dealId, 'send-customer'); + } + //添加邮件发送记录 end + // TODO 如果已做账, 标记需要通知财务send-to-finance, 通知时间用订单日志记录 + + return ; + } + /** * alipay.trade.query (统一收单线下交易查询) * @param $builder 业务参数,使用buildmodel中的对象生成。 @@ -538,7 +724,7 @@ class AlipayTradeService extends CI_Controller return $response; } - public function query_pay($dealId=NULL,$orderId=NULL) + public function query_pay($dealId=NULL,$orderId=NULL, $debug=false) { if ($dealId === NULL) { $dealId = $this->input->get_post('dealid'); @@ -549,20 +735,24 @@ class AlipayTradeService extends CI_Controller $this->AlipayTradeQueryContentBuilder->setOutTradeNo($orderId); } $response = $this->Query($this->AlipayTradeQueryContentBuilder); - // return $this->output->set_content_type('application/json')->set_output(json_encode($response)); + if ($debug != false) { + return $this->output->set_content_type('application/json')->set_output(json_encode($response)); // test + } return $response; } /*! * 查询退款 * @date 2019-04-24 - * @param [type] $dealId 必须, 退款交易号.out_biz_no - * @param [type] $trade_no 必须, 原收款交易号 + * @param [type] $dealId 必须, 退款请求号.out_biz_no, 或原始交易订单号 + * @param [type] $trade_no 必须, 原收款交易号, 和order_id不能同时为空 + * @param [type] $order_id 必须, 原收款订单号, 和trade_no不能同时为空 */ - public function query_refund($dealId=NULL,$trade_no=NULL) + public function query_refund($dealId=NULL,$trade_no=NULL, $order_id=NULL) { - $this->AlipayTradeQueryContentBuilder->setTradeNo($trade_no); $this->AlipayTradeQueryContentBuilder->setOutRequestNo($dealId); + $this->AlipayTradeQueryContentBuilder->setTradeNo($trade_no); + $this->AlipayTradeQueryContentBuilder->setOutTradeNo($order_id); $biz_content=$this->AlipayTradeQueryContentBuilder->getBizContent(); $request = new AlipayTradeFastpayRefundQueryRequest(); @@ -589,7 +779,7 @@ class AlipayTradeService extends CI_Controller $request = new AlipayDataDataserviceBillDownloadurlQueryRequest(); $request->setBizContent("{" . "\"bill_type\":\"signcustomer\"," . - "\"bill_date\":\"2019-04-03\"" . + "\"bill_date\":\"2019-04-25\"" . "}"); $response = $this->aopclientRequestExecute ($request); // var_dump($response); @@ -779,6 +969,7 @@ var_dump($response->$responseNode); } //修改订单名 + // TODO 支持转移功能 public function note_modal_save() { $data = array(); diff --git a/webht/third_party/pay/models/Alipay_model.php b/webht/third_party/pay/models/Alipay_model.php index 27be3647..150e3c4e 100644 --- a/webht/third_party/pay/models/Alipay_model.php +++ b/webht/third_party/pay/models/Alipay_model.php @@ -18,7 +18,7 @@ class Alipay_model extends CI_Model { $fieldsql = $orderinfo == false ? '' : " ,* "; //先查商务订单B,APP订单A、再查传统订单T if ($ordertype == 'B' || $ordertype == 'A') { - $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 + $sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,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 =?"; $query = $this->HT->query($sql, array($COLI_ID)); @@ -26,7 +26,7 @@ class Alipay_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 + $sql = "SELECT TOP 2 1 as order_type, COLI_SN,COLI_ID,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'"; $query = $this->HT->query($sql); @@ -36,7 +36,7 @@ class Alipay_model extends CI_Model { //查传统订单add_code,网前实时支付会先生成一个临时订单号存在add_code里,如订单45103248 if (empty($result) && ($ordertype == 'M')) { - $sql = "SELECT TOP 2 1 as order_type, COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode $fieldsql from ConfirmLineInfo + $sql = "SELECT TOP 2 1 as order_type, COLI_SN,COLI_ID,OPI_SN,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode $fieldsql from ConfirmLineInfo LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN where COLI_AddCode =? "; $query = $this->HT->query($sql, array($COLI_ID)); @@ -44,7 +44,7 @@ class Alipay_model extends CI_Model { } if (empty($result) && ($ordertype == 'M')) { - $sql = "SELECT TOP 2 1 as order_type, COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode $fieldsql from ConfirmLineInfo cli + $sql = "SELECT TOP 2 1 as order_type, COLI_SN,COLI_ID,OPI_SN,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode $fieldsql from ConfirmLineInfo cli LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN where EXISTS ( @@ -60,7 +60,7 @@ class Alipay_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 + $sql = "SELECT TOP 2 0 as order_type,COLI_SN,COLI_ID,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%'"; $query = $this->HT->query($sql); @@ -144,7 +144,7 @@ class Alipay_model extends CI_Model { $sql = " SELECT TOP 1 1 FROM BIZ_GroupAccountInfo WHERE (GAI_AccreditNo = ? OR GAI_Memo LIKE '%$GAI_AccreditNo%') AND DeleteFlag=0"; - $result = $this->HT->query($sql, array($GAI_AccreditNo)); + $result = $this->HT->query($sql, array(substr($GAI_AccreditNo,0,30))); return ($result->num_rows() > 0); } @@ -175,7 +175,7 @@ class Alipay_model extends CI_Model { ,GAI_State ,DeleteFlag ) VALUES (?,?,15015,?,?,?,?,?,?,?,?,?,?,?,0,0)"; - $query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); + $query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, substr($GAI_AccreditNo,0, 30), $GAI_Memo)); $insertid = $this->HT->last_id('BIZ_GroupAccountInfo'); return $query; } @@ -209,7 +209,7 @@ class Alipay_model extends CI_Model { ,GAI_State ,DeleteFlag ) VALUES (?,?,15015,?,?,?,?,?,?,?,?,?,?,?,?,0,0)"; - $query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_Money, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); + $query = $this->HT->query($sql, array(substr($GAI_AccreditNo,0, 30), $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_Money, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, substr($GAI_AccreditNo,0, 30), $GAI_Memo)); $insertid = $this->HT->last_id('BIZ_GroupAccountInfo'); return $query; } @@ -242,8 +242,8 @@ class Alipay_model extends CI_Model { ,DeleteFlag ) VALUES (?,15015,?,?,?,?,?,?,?,?,?,?,?,0,0) ELSE - UPDATE GroupAccountInfo SET GAI_SSJE='$GAI_SSJE' WHERE GAI_AccreditNo='$GAI_AccreditNo' "; - $query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo)); + UPDATE GroupAccountInfo SET GAI_SSJE='$GAI_SSJE' WHERE GAI_AccreditNo='" . substr($GAI_AccreditNo,0, 30) ."' "; + $query = $this->HT->query($sql, array(substr($GAI_AccreditNo,0, 30), $GAI_COLI_SN, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSJE, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, substr($GAI_AccreditNo,0, 30), $GAI_Memo)); $insertid = $this->HT->last_id('GroupAccountInfo'); return $insertid; } @@ -370,4 +370,47 @@ class Alipay_model extends CI_Model { } return 0; } + + public function get_advisor_detail($COLI_SN, $OPI_SN, $lgc=1) + { + $advisor_signature = $this->get_advisor_signature($COLI_SN); + if (empty($advisor_signature)) { + $sql = "SELECT OPI_SN, '+86-'+OPI_MoveTelephone mobile,'+86-773-'+OPI_Telephone tel,OPI_Email email,OPI2_Name fullname,OPI2_FirstName,OPI2_LastName + FROM [Tourmanager].[dbo].[V_Operator_Info] + where OPI_SN=? and LGC_LGC=? "; + $advisor_signature = $this->HT->query($sql, array($OPI_SN, $lgc))->row(); + } + return $advisor_signature; + } + public function get_advisor_signature($COLI_SN) + { + $sql = "SELECT top 1 dbo.agenter_user.Name fullname, dbo.agenter_user.tel, + dbo.agenter_user.Email email, dbo.agenter_user.mobile, OPI_DEI_SN, COLI_OPI_ID + FROM dbo.BIZ_ConfirmLineInfo + INNER JOIN dbo.agenter_user ON dbo.BIZ_ConfirmLineInfo.COLI_OPI_ID = dbo.agenter_user.AU_OPI_SN + AND + (dbo.BIZ_ConfirmLineInfo.COLI_WebCode = dbo.agenter_user.agenter + OR (COLI_WebCode in ('EXPCH','MESENLLA','traba','wayaway','guias') and agenter='VAC') + ) + LEFT JOIN OperatorInfo on COLI_OPI_ID = OPI_SN + WHERE (dbo.BIZ_ConfirmLineInfo.COLI_SN = ?)"; + return $this->HT->query($sql, array($COLI_SN))->row(); + } + + public function get_customer_detail($COLI_SN, $ordertype) + { + if ($ordertype === 'T') { + $sql = "SELECT mei.MEI_FirstName+' '+isnull(mei.MEI_MiddleName,'')+' '+isnull(mei.MEI_LastName,'') fullname, + mei.MEI_MailList email + FROM MEmberInfo mei + INNER JOIN CUstomerList cul on mei.MEI_SN=cul.CUL_CUI_SN and cul.CUL_IsLinkMan=1 + WHERE CUL_COLI_SN=? "; + return $this->HT->query($sql, $COLI_SN)->row(); + } else { + $sql = "SELECT GUT_FirstName+' '+GUT_LastName fullname,GUT_Email email from BIZ_GUEST g + INNER JOIN BIZ_ConfirmLineInfo coli on coli.COLI_GUT_SN=g.GUT_SN + WHERE COLI_SN=? "; + return $this->HT->query($sql, $COLI_SN)->row(); + } + } } diff --git a/webht/third_party/pay/views/alipay_list.php b/webht/third_party/pay/views/alipay_list.php index faceb099..ced5d78e 100644 --- a/webht/third_party/pay/views/alipay_list.php +++ b/webht/third_party/pay/views/alipay_list.php @@ -162,8 +162,8 @@ ALI_sent == 'send') { - $show_send = $item->ALI_sent; + if ($item->ALI_sent == 'send' || substr($item->ALI_sent, 0, 5) == "send-") { + $show_send = 'send'; } else if (strcmp(trim($item->ALI_resultMsg), "TRADE_SUCCESS")) { $class_css = 'btn-danger'; // $show_send = $paytext[intval(trim($item->ALI_resultMsg))]; diff --git a/webht/third_party/pay/views/alipay_note_setting.php b/webht/third_party/pay/views/alipay_note_setting.php index e1bcc4bb..d5ab442f 100644 --- a/webht/third_party/pay/views/alipay_note_setting.php +++ b/webht/third_party/pay/views/alipay_note_setting.php @@ -1,4 +1,4 @@ -
+
交易号