From 2bd7df0795296c84a75ca588fca0076e4334209b Mon Sep 17 00:00:00 2001 From: cyc Date: Mon, 20 May 2019 10:07:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=80=E7=A5=A8=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E5=8F=91=E9=80=81=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trainsystem/controllers/returnorders.php | 33 +++++++++++-------- .../third_party/trainsystem/views/refund.php | 2 +- 2 files changed, 20 insertions(+), 15 deletions(-) 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,