修改退票邮件发送规则

feature/pay
cyc 6 years ago
parent 61c69e15a6
commit 2bd7df0795

@ -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 = '<p>Dear '.$data->tst_realname.',</p><p>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 = '<p>Dear '.$data->tst_realname.',</p><p>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 = '<p>Dear '.$data->tst_realname.',</p><p>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.</p>';
$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 = '<p>Dear '.$data->tst_realname.',</p><p>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.</p>';
$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"}';
}

@ -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,

Loading…
Cancel
Save