diff --git a/application/third_party/trainsystem/controllers/api.php b/application/third_party/trainsystem/controllers/api.php
index b4ef1121..c62c3293 100644
--- a/application/third_party/trainsystem/controllers/api.php
+++ b/application/third_party/trainsystem/controllers/api.php
@@ -87,7 +87,7 @@ class api extends CI_Controller{
//发送邮件给客人
$flag = $this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
$this->BIZ_train_model->update_biz_jol(array("ts_ordernumber"=>$jh_order),array("ts_sendmail"=>1,"ts_m_sn"=>$flag));
- }else if($status == '1' && $differtime < 18 && $differtime > 0){
+ }else if($status == '1'){
$subject = "The train ticket(s) will be issued manually, Order No $coli_id";
$body = $this->load->view('email_fault',$data,true);
$this->send_mail_to_wl("订单:{$coli_id} 出票失败","翰特订单号:{$coli_id};聚合订单号:{$jh_order}",$coli_id);
@@ -96,10 +96,6 @@ class api extends CI_Controller{
//测试阶段,将失败邮件发送一份给操作外联。
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
$this->BIZ_train_model->update_biz_jol(array("ts_ordernumber"=>$jh_order),array("ts_sendmail"=>1,"ts_m_sn"=>$flag));
- }else{
- echo $jh_order.'不需要发邮件
';
- $this->BIZ_train_model->update_biz_jol(array("ts_ordernumber"=>$jh_order),array("ts_sendmail"=>2));
- $flag = false;
}
}
diff --git a/application/third_party/trainsystem/controllers/returnorders.php b/application/third_party/trainsystem/controllers/returnorders.php
index 82e7aa31..a4a9b263 100644
--- a/application/third_party/trainsystem/controllers/returnorders.php
+++ b/application/third_party/trainsystem/controllers/returnorders.php
@@ -10,7 +10,7 @@ class returnorders extends CI_Controller{
$this->load->model("train_system_model");
$this->load->model("Sendmail_model");
$this->load->model('BIZ_train_model');
-
+ $this->usercenter = 'yes';
}
public function index(){
@@ -29,6 +29,8 @@ class returnorders extends CI_Controller{
$passportname = $this->input->get_post('passportname');
//护照号
$passportno = $this->input->get_post('passportno');
+ //判断是否为用户中心操作
+ $this->usercenter = $this->input->get_post('usercenter');
if(!$ordernumber || !$passportname || !$passportno){
header("HTTP/1.1 404 Not Found");
@@ -72,7 +74,6 @@ class returnorders extends CI_Controller{
$ticket_no = $items->ticket_no;
}
}
-
//发起退票
$post_data1 = array(
"key"=>JUHE_TRAIN_API_KEY,
@@ -100,24 +101,28 @@ class returnorders extends CI_Controller{
$body = $back_detail_data->result->ordernumber.' 提出退票,乘客:'.$data->tst_realname.', '.$back_detail_data->result->start_time.' '.$back_detail_data->result->checi;
//发送邮件给外联
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
- //发送邮件给客人
- $customer_subject = 'China Train Ticket(s) Cancelation';
- $customer_body = '
Dear '.$data->tst_realname.',
Your tickets (ticket number '.$back_detail_data->result->ordernumber.', for name '.$data->tst_realname.', train No. '.$back_detail_data->result->checi.') have been cancelled online successfully. Your travel advisor ('.$toName.', email address: '.$toEmail.', phone number '.$Mobile.') will contact you with the refund details via email within 24 hours.'; - $customer_email = $this->BIZ_train_model->get_guest_info($coli_id); - $customer_email = $customer_email[0]->GUT_Email; - $this->Sendmail_model->SendMailToTable($toName,$toEmail,$data->tst_realname,$customer_email,$customer_subject,$customer_body); + if($this->usercenter == 'yes'){ + //发送邮件给客人 + $customer_subject = 'China Train Ticket(s) Cancelation'; + $customer_body = '
Dear '.$data->tst_realname.',
Your tickets (ticket number '.$back_detail_data->result->ordernumber.', for name '.$data->tst_realname.', train No. '.$back_detail_data->result->checi.') have been cancelled online successfully. Your travel advisor ('.$toName.', email address: '.$toEmail.', phone number '.$Mobile.') will contact you with the refund details via email within 24 hours.'; + $customer_email = $this->BIZ_train_model->get_guest_info($coli_id); + $customer_email = $customer_email[0]->GUT_Email; + $this->Sendmail_model->SendMailToTable($toName,$toEmail,$data->tst_realname,$customer_email,$customer_subject,$customer_body); + } echo '{"reason":"退票成功","status":"200"}'; }else{ //退票失败后发送邮件 $body = $ticket_data->ts_ordernumber.'退票失败'; //发送邮件给外联 $this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body); - //发送邮件给客人 - $customer_subject = 'China Train Ticket(s) Cancelation'; - $customer_body = '
Dear '.$data->tst_realname.',
Your application for online ticket cancellation (ticket number '.$back_detail_data->result->ordernumber.', for name '.$data->tst_realname.', train No.'.$back_detail_data->result->checi.') has failed.Your travel advisor('.$toName.', email address: '.$toEmail.', phone number '.$Mobile.') will contact you via email within 24 hours. Please call us if you need to contact us urgently.
'; - $customer_email = $this->BIZ_train_model->get_guest_info($coli_id); - $customer_email = $customer_email[0]->GUT_Email; - $this->Sendmail_model->SendMailToTable($toName,$toEmail,$data->tst_realname,$customer_email,$customer_subject,$customer_body); + if($this->usercenter == 'yes'){ + //发送邮件给客人 + $customer_subject = 'China Train Ticket(s) Cancelation'; + $customer_body = 'Dear '.$data->tst_realname.',
Your application for online ticket cancellation (ticket number '.$back_detail_data->result->ordernumber.', for name '.$data->tst_realname.', train No.'.$back_detail_data->result->checi.') has failed.Your travel advisor('.$toName.', email address: '.$toEmail.', phone number '.$Mobile.') will contact you via email within 24 hours. Please call us if you need to contact us urgently.
'; + $customer_email = $this->BIZ_train_model->get_guest_info($coli_id); + $customer_email = $customer_email[0]->GUT_Email; + $this->Sendmail_model->SendMailToTable($toName,$toEmail,$data->tst_realname,$customer_email,$customer_subject,$customer_body); + } header("HTTP/1.1 404 Not Found"); echo '{"reason":"退票失败","status":"404"}'; } diff --git a/application/third_party/trainsystem/views/refund.php b/application/third_party/trainsystem/views/refund.php index 6eeeac99..2737c70b 100644 --- a/application/third_party/trainsystem/views/refund.php +++ b/application/third_party/trainsystem/views/refund.php @@ -30,7 +30,7 @@ $(function(){ var return_ticket = $(this); name = $(this).attr('name'); passid = $(this).attr('passid'); - url += '&passportname='+name+'&passportno='+passid; + url += '&passportname='+name+'&passportno='+passid+'&usercenter=no'; //console.log(url);return false; $.ajax({ url:url,