From c4d75daeea4b705cf4f5fd0693a0b2ad8c4d7cc3 Mon Sep 17 00:00:00 2001 From: lyt Date: Fri, 21 Jun 2019 11:43:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=AF=E5=90=A6=E5=8F=91?= =?UTF-8?q?=E9=80=81=E9=82=AE=E4=BB=B6;=E8=AE=B0=E5=BD=95=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=9A=84=E5=8F=91=E9=80=81=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pay/controllers/PaymentService.php | 41 ++++++++++--------- webht/third_party/pay/views/payment_list.php | 2 +- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/webht/third_party/pay/controllers/PaymentService.php b/webht/third_party/pay/controllers/PaymentService.php index d85143e0..5d5468e9 100644 --- a/webht/third_party/pay/controllers/PaymentService.php +++ b/webht/third_party/pay/controllers/PaymentService.php @@ -100,9 +100,10 @@ class PaymentService extends CI_Controller { // 填入提取到的订单号 $this->note_model->set_invoice($item->OPN_SN, $orderid_info->orderid . '_' . $orderid_info->ordertype); + $send_email = true; // APP自动出票的收款 跳过 - // todo: 检测APP收款是否存在 if ($orderid_info->ordertype === 'A' && $item->OPN_noticeType === 'pay') { + $send_email = false; // $this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'closed'); // continue; } @@ -125,7 +126,7 @@ class PaymentService extends CI_Controller { if ($advisor_info->order_type == 0) { /* 商务订单 */ // todo: 检测收/退款是否存在 - if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP') { + if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP' && strstr($advisor_info->COLI_WebCode, "-") !== '-biz') { /* APP */ $this->account_model->add_account_info_forAPP( $COLI_SN, @@ -226,7 +227,7 @@ class PaymentService extends CI_Controller { } //添加邮件发送记录 //给外联发送通知邮件 - if ($handpick===false && $item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-') { + if ($send_email===true && $handpick===false && $item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-') { $fromName = !empty($item->OPN_payerName) ? $item->OPN_payerName : ''; $fromEmail = !empty($item->OPN_payerEmail) ? $item->OPN_payerEmail : ''; $toName = !empty($opi_firstname) ? $opi_firstname : ''; @@ -236,7 +237,7 @@ class PaymentService extends CI_Controller { $M_RelatedInfo = $item->OPN_SN; $M_AddTime = $item->OPN_completeTime; $M_State = 0; - // $this->account_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'payment note', 'payment note'); + $this->account_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'payment note', 'payment note'); //添加邮件发送记录 end $this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'send'); } @@ -244,7 +245,7 @@ class PaymentService extends CI_Controller { // todo:iPaylinks需要发收款, 退款发所有 // 3. 更新是否发送财务 if($is_refund === true ) { - $this->send_refund($item, $orderid_info, $advisor_info); + $this->send_refund($send_email, $item, $orderid_info, $advisor_info); } //显示处理记录 @@ -257,10 +258,12 @@ class PaymentService extends CI_Controller { // return $this->output->set_content_type('application/json')->set_output(json_encode($data)); } - public function send_refund($item, $orderid_info, $advisor_info) + public function send_refund($send_email, $item, $orderid_info, $advisor_info) { // 发送客人 - if ( $item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-' ) { + if ($send_email===true + && $item->OPN_noticeSendStatus !== 'send' && substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-' + ) { // 客人邮件中的外联落款 // $web_code = 'cht'; // 默认cht $web_lgc = 1; @@ -292,18 +295,18 @@ class PaymentService extends CI_Controller { $c_M_RelatedInfo = $item->OPN_SN; $c_M_AddTime = $item->OPN_completeTime; $c_M_State = 0; - // $this->account_model->save_automail( - // $c_fromName, - // $c_fromEmail, - // $c_toName, - // $c_toEmail, - // $c_subject, - // $c_body, - // $c_M_RelatedInfo, - // $c_M_State, - // $c_M_AddTime, - // 'ChinaHighlights refund receipt', - // 'payment note'); + $this->account_model->save_automail( + $c_fromName, + $c_fromEmail, + $c_toName, + $c_toEmail, + $c_subject, + $c_body, + $c_M_RelatedInfo, + $c_M_State, + $c_M_AddTime, + 'ChinaHighlights refund receipt', + 'payment note'); $this->note_model->update_send($item->OPN_SN, $item->OPN_transactionId, 'send-customer'); } // 更新是否需要发送财务 diff --git a/webht/third_party/pay/views/payment_list.php b/webht/third_party/pay/views/payment_list.php index 11d194db..14a20a8f 100644 --- a/webht/third_party/pay/views/payment_list.php +++ b/webht/third_party/pay/views/payment_list.php @@ -207,7 +207,7 @@ if ($item->OPN_accountStatus !== 'recorded') { $send_class = 'btn-danger'; } - if ($item->OPN_noticeSendStatus !== 'send' ) { + if ($item->OPN_noticeSendStatus !== 'send' || substr($item->OPN_noticeSendStatus, 0, 5) !== 'send-') { $send_class = 'btn-danger'; } if ($item->OPN_noticeSendStatus === 'closed') {