diff --git a/application/third_party/trainsystem/controllers/api.php b/application/third_party/trainsystem/controllers/api.php index e80900db..5fb5f56c 100644 --- a/application/third_party/trainsystem/controllers/api.php +++ b/application/third_party/trainsystem/controllers/api.php @@ -225,6 +225,41 @@ class api extends CI_Controller{ } } + public function send_options_mail_to_wl(){ + header('Access-Control-Allow-Origin:*'); + header('Access-Control-Allow-Methods:POST, GET'); + header('Access-Control-Max-Age:0'); + header('Access-Control-Allow-Headers:x-requested-with, Content-Type'); + header('Access-Control-Allow-Credentials:true'); + $fromName = "cyc"; + $fromEmail = "cyc@hainatravel.com"; + + $order = $this->input->get_post('order'); + $person = $this->input->get_post('person'); + $type = $this->input->get_post('type'); + $request = $this->input->get_post('request'); + $body = ''; + + $coli_id = $this->BIZ_train_model->cold_sn_get_coli_id($order); + $trainInfos = $this->BIZ_train_model->biz_order_detail($order); + $passager = $this->BIZ_train_model->in_bpesn_people_info($person); + + $body .= '订单号:'.$coli_id['0']->COLI_ID.'
'; + $body .= '车程:'.$trainInfos->DepartAirport_cn.'->'.$trainInfos->ArrivalAirport_cn.','.$trainInfos->FlightsNo.','.date('Y-m-d',strtotime($trainInfos->DepartureDate)).'
'; + $body .= '乘客:'.$passager['0']->BPE_FirstName.$passager['0']->BPE_MiddleName.$passager['0']->BPE_LastName.','.$passager['0']->BPE_Passport.'
'; + $body .= '操作:'.$type.'
'; + $body .= '详细信息:'.$request.'
'; + + $toName = 'Sharon'; + $toEmail = 'Sharon@hainatravel.com'; + $subject = '用户中心操作'; + + $obj = $this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body); + if($obj){ + exit('{"status":"200","reason":"邮件发送成功"}'); + } + } + //导出账单api public function export_excel(){ set_time_limit(0);