From 829c128493accd38f4dd0947164ee8cc338ebba8 Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 6 Jun 2017 15:31:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E4=BF=AE=E6=94=B9=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=87=BA=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/train/controllers/auto.php | 31 ++++++-- .../train/models/BIZ_train_model.php | 14 +++- application/third_party/train/views/email.php | 70 +++++++++++++++++++ 3 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 application/third_party/train/views/email.php diff --git a/application/third_party/train/controllers/auto.php b/application/third_party/train/controllers/auto.php index a6d1dff4..395f4de3 100644 --- a/application/third_party/train/controllers/auto.php +++ b/application/third_party/train/controllers/auto.php @@ -1,5 +1,4 @@ -load->model("BIZ_train_model");//加载模型 } - + + public function auto_check_ticket(){ + $ticket_info = $this->BIZ_train_model->auto_check_ticket(); + print_r($ticket_info); + foreach($ticket_info as $value){ + if(strlen($value->GUT_Passport) < 18){ + $this->auto_pay_ticket($value->COLI_SN); + } + } + } //用于自动出票,接收COLI_SN - public function auto_pay_ticket(){ + public function auto_pay_ticket($coli_sn){ date_default_timezone_set('Asia/Shanghai'); // $coli_sn="473013018"; - $coli_sn = $this->input->post("coli_sn"); + //$coli_sn = $this->input->post("coli_sn"); $list=new StdClass; $back_data = 1; - + if(!empty($coli_sn)){ $cold_sn=$this->BIZ_train_model->get_cold_sn($coli_sn); $coli_id = $this->BIZ_train_model->coli_sn_get_coli_id($coli_sn); $i = 0; $list->info=array(); foreach ($cold_sn as $v) { + //print_r(empty($this->BIZ_train_model->auto_check_pullticket($v->COLD_SN))); + if(empty($this->BIZ_train_model->auto_check_pullticket($v->COLD_SN))){ + $back_data = 1; + break; + } if($v->COLD_SPFS > 1){ //寄送票 $back_data = 0; @@ -181,6 +194,10 @@ class Auto extends CI_Controller{ "passengers"=>$passengers, "checi"=>$data["train"]->FlightsNo ); + + print_r($url); + print_r($post_data); + die(); // $bakc_json=$this->post_data($url,$post_data); $bakc=json_decode($bakc_json);//json=>obj @@ -382,4 +399,4 @@ class Auto extends CI_Controller{ return $output; } -} \ No newline at end of file +} diff --git a/application/third_party/train/models/BIZ_train_model.php b/application/third_party/train/models/BIZ_train_model.php index b144c738..17688ca1 100644 --- a/application/third_party/train/models/BIZ_train_model.php +++ b/application/third_party/train/models/BIZ_train_model.php @@ -6,7 +6,19 @@ class BIZ_train_model extends CI_Model { parent::__construct(); $this->HT = $this->load->database('HT', TRUE); } - + + function auto_check_ticket(){ + $sql = "select top 200 * from BIZ_ConfirmLineInfo bcli left join BIZ_Guest bg on bcli.COLI_GUT_SN = bg.GUT_SN where COLI_ServiceType = '2' and COLI_State ='62' ORDER BY bcli.COLI_SN DESC"; + $query = $this->HT->query($sql); + return $query->result(); + } + + function auto_check_pullticket($coli_sn){ + $sql = "SELECT * FROM BIZ_JuheOrderList where JOL_COLD_SN = '$coli_sn'"; + $query = $this->HT->query($sql); + return $query->row(); + } + function biz_order_detail($cold_sn) { $sql = " SELECT TOP 1 bfoi.FOI_SN diff --git a/application/third_party/train/views/email.php b/application/third_party/train/views/email.php new file mode 100644 index 00000000..66184036 --- /dev/null +++ b/application/third_party/train/views/email.php @@ -0,0 +1,70 @@ + + + + +无标题文档 + + + +

China Highlights Booking Confirmation

+

Dear GUT_LastName?>,

+

Thanks for payment US$145 . The train tickets have already been issued.

+

You can collect the paper ticket(s) from now at any train station in mainland China.

+

Please present all passenger(s) original passport(s) and Ticket Pick Up No.E601014106  at any ticket collecting counters (in Chinese 取票窗口)of any railway stations in mainland China. They will then issue your paper train ticket(s).

+ + + + + +
Passenger(s)

2 adult(s) +

+

1. ALEXANDER JAMES JOHNSON , passport number 503406354
+2. SIAN MARIE JOHNSON , passport number 528876517

+

Train 1:

+ + + + + + + + + + + + + + + + + + + + + +
Ticket Pick Up No.E601014106 
Train No.Z19
Departure20:40 Jun.06 Beijing Xi (West) Station(in Chinese 北京西火车站)
Arrival08:31AM Jun.07 Xi'an Station(in Chinese 西安火车站)
ClassSoft Sleeper
+

Kindly note below:

+

1. The same passport that was used for booking should also be used for ticket collection. A renewed passport won't be acceptable even if the holder is the same person. The system does not allow us to change passport number or passenger name after issue ticket. Have to issue new ticket if wrong passport number or name.

+

2. There is no further fee if collect train ticket(s) at the DEPARTURE station shown on your ticket(s). RMB 5 per ticket will be charged at a ticket counter at other stations. E.g. if you have booked Beijing-Shanghai and Shanghai-Beijing ticket(s), and you collect them all at Beijing, you will be charged RMB 5 per ticket for the Shanghai-Beijing ticket(s), but if you pick up the return leg ticket(s) separately in Shanghai you will avoid the charge.

+

3. On departure day, please time your arrival wisely. If you are going to collect your tickets on departure day, we suggest you be at the station at least 1.5 hours ahead of the stated departure time to allow for waiting in queue at the ticket-counter, for security checks and for ticket checks.
+If you’ve already collected before the departure day, it is also wise to be at the station at least 40 minutes ahead.

+

4. Download railway station instructions, maps and tips at http://www.chinahighlights.com/china-trains/station-map.htm
+
+5.Terms & Conditions. http://www.chinahighlights.com/china-trains/booking-policy.htm

+

Best Regards!
+ Iris Wang, Travel Advisor
+ Tel: +86-773-2801368  Mobile:+86-18775900313
+ Fax: 86-773-2827424, 86-773-2885308
+ E-mail: iris@chinahighlights.me
+ www.chinahighlights.com
+ Address: Building 6, Chuangyi Business Park, 70 Qilidian Road, Guilin, Guangxi, 541004, China
+If you wish to share anything with my supervisor (Ms. Alex Yang), please feel free to send your email to alex@chinahighlights.net.

+ +