|
|
|
@ -653,6 +653,8 @@ class Index extends CI_Controller {
|
|
|
|
|
$ordertype = 'T';
|
|
|
|
|
} elseif (substr($ordertype_temp, 0, 1) == 'B') {
|
|
|
|
|
$ordertype = 'B';
|
|
|
|
|
} elseif (substr($ordertype_temp, 0, 1) == 'A') {
|
|
|
|
|
$ordertype = 'A';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 2018.05.28 for Trippest, tourMaster的订单号是01开头
|
|
|
|
@ -909,10 +911,9 @@ class Index extends CI_Controller {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
$orderid_info = json_decode($orderid_info);
|
|
|
|
|
// for trippest tourMaster 2018.05.28
|
|
|
|
|
if ($orderid_info->ordertype == 'TP') {
|
|
|
|
|
$this->trippest_note($orderid_info, $item);
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (in_array($orderid_info->ordertype, array('TP', 'A')) ) {
|
|
|
|
|
$orderid_info->ordertype = 'B';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据订单号查找外联信息
|
|
|
|
@ -968,16 +969,21 @@ class Index extends CI_Controller {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$web_code = $advisor_info->COLI_WebCode;
|
|
|
|
|
//添加邮件发送记录
|
|
|
|
|
if ($item->pn_send !== 'send' && substr($item->pn_send, 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])) {
|
|
|
|
|
$web_code = 'cht';
|
|
|
|
|
}
|
|
|
|
|
if (isset($site_info[$web_code])) {
|
|
|
|
|
$site_info = $site_info[$web_code];
|
|
|
|
|
$advisor_detail = $this->Paypal_model->get_advisor_detail($advisor_info->OPI_SN, $site_info['site_lgc']);
|
|
|
|
|
$item->advisor_detail = $advisor_detail;
|
|
|
|
|
$item->site = $site_info['site_url'];
|
|
|
|
|
//添加邮件发送记录
|
|
|
|
|
$web_lgc = $site_info['site_lgc'];
|
|
|
|
|
}
|
|
|
|
|
$advisor_detail = $this->Paypal_model->get_advisor_detail($advisor_info->COLI_SN, $advisor_info->OPI_SN, $web_lgc);
|
|
|
|
|
$item->advisor_detail = $advisor_detail;
|
|
|
|
|
|
|
|
|
|
//给外联发送通知邮件
|
|
|
|
|
$fromName = !empty($item->pn_payer) ? $item->pn_payer : '';
|
|
|
|
|
$fromEmail = !empty($item->pn_payer_email) ? $item->pn_payer_email : '';
|
|
|
|
@ -991,8 +997,9 @@ class Index extends CI_Controller {
|
|
|
|
|
$this->Paypal_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'paypal note');
|
|
|
|
|
// 通知客人, 客人邮箱
|
|
|
|
|
$customer_detail = $this->Paypal_model->get_customer_detail($advisor_info->COLI_SN, $orderid_info->ordertype);
|
|
|
|
|
$c_fromName = $advisor_detail->OPI2_Name;
|
|
|
|
|
$c_fromEmail = $advisor_detail->OPI_Email;
|
|
|
|
|
$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 = $item->pn_mc_currency . " " . str_replace('-', '', $item->pn_mc_gross) . " Refunded to your account, booking number " . $item->pn_invoice;
|
|
|
|
@ -1012,8 +1019,9 @@ class Index extends CI_Controller {
|
|
|
|
|
$c_M_AddTime,
|
|
|
|
|
'paypal refund receipt');
|
|
|
|
|
$this->Note_model->update_send($item->pn_txn_id, 'send-customer');
|
|
|
|
|
// TODO 通知财务, 如果已做账
|
|
|
|
|
}
|
|
|
|
|
//添加邮件发送记录 end
|
|
|
|
|
// TODO 如果已做账, 标记需要通知财务send-to-finance, 通知时间用订单日志记录
|
|
|
|
|
|
|
|
|
|
return ;
|
|
|
|
|
}
|
|
|
|
|