diff --git a/application/third_party/train/config/config.php b/application/third_party/train/config/config.php index 573d5514..99cbb15f 100644 --- a/application/third_party/train/config/config.php +++ b/application/third_party/train/config/config.php @@ -1,5 +1,13 @@ "软座", "3"=>"硬卧", "1"=>"硬座", + "F"=>"动卧", ); //数据库座次配对,包厢硬卧(5),无座(WZ),聚合没有 $config["db_train_zw"]=array( @@ -65,7 +74,7 @@ $config["db_train_zw"]=array( "A"=>"6", "S"=>"4", "4"=>"4", - "F"=>"4", + "F"=>"F", "3"=>"3", "2"=>"2", "1"=>"1", @@ -85,4 +94,8 @@ $config["train_passportty"]=array( "2"=>"一代身份证", "C"=>"港澳通行证", "G"=>"台湾通行证" - ); \ No newline at end of file + ); + +//黑名单用户 +$config['black_list'] = array('209582910','539152642','506157109','E66735489','E66735492','E80377215','G23001338','E95287649','345276546','PA4286015','G09382769','G26113116','G25996274','572309763','506620366','505897939','E71156367','E21961674','v716898','561669436','EL657289','533300106','482225223','514815909','592108236'); + \ No newline at end of file diff --git a/application/third_party/train/config/constants.php b/application/third_party/train/config/constants.php new file mode 100644 index 00000000..9d315fd5 --- /dev/null +++ b/application/third_party/train/config/constants.php @@ -0,0 +1,4 @@ +code_zw=$this->config->item('train_zw'); $this->piaotype=$this->config->item('train_piaotype'); $this->passportty=$this->config->item('train_passportty'); - - $this->load->model("BIZ_train_model");//加载模型 + $this->balance_api = "http://op.juhe.cn/trainTickets/balance.php";//余额 + $this->load->model("BIZ_train_model");//加载模型 } + + //index + public function index(){ + echo 'index'; + //print_r($black_list); + } - - //用于自动出票,接收COLI_SN + //用于自动发送确认信 + public function send_confirmmail(){ + //header('Location: http://www.mycht.cn/info.php/apps/trainsystem/api/send_confirmmail'); + die(); + $mailarr = $this->BIZ_train_model->auto_sendmail(); + foreach($mailarr as $obj){ + $coli_id = $this->BIZ_train_model->cold_sn_get_coli_id($obj->JOL_COLD_SN); + $coli_id = $coli_id[0]->COLI_ID; + $juhe_order = $obj->JOL_JuheOrder; + $this->send_mail_to_guest($coli_id,$juhe_order); + } + } + + //用于自动出票 public function auto_pay_ticket(){ + //header('Location: http://www.mycht.cn/info.php/apps/trainsystem/addorders/auto_pay_ticket'); + die(); date_default_timezone_set('Asia/Shanghai'); - // $coli_sn="473013018"; - $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) { - if($v->COLD_SPFS > 1){ - //寄送票 - $back_data = 0; - break; - } - $list->info[$i]=new StdClass; - $list->info[$i]->people=$this->BIZ_train_model->biz_people($v->COLD_SN); - $list->info[$i]->train=$this->BIZ_train_model->get_biz_foi($v->COLD_SN); - $list->info[$i]->status=$this->BIZ_train_model->get_biz_jol($v->COLD_SN); - - if(count($list->info[$i]->people) > 5){ - $back_data = 0; - break; - }; - if((strtotime($list->info[$i]->train[0]->DepartureTime) - time())/3600 < 3 or (strtotime($list->info[$i]->train[0]->DepartureTime) - time())/24/3600 >29){ - $back_data = 0; - break; - } - if($list->info[$i]->train[0]->adultcost > 1000){ - $back_data = 0; - break; - } - $i++; - } - if($back_data == 0){ - echo 0; - return false; - }else{ - foreach ($cold_sn as $v) { - $reback = $this->submit_juhe_order($v->COLD_SN,$coli_id[0]->COLI_ID); - if($reback["status"] && !empty($reback["order"])){ - $back_data .= ",".$reback["order"]; - } - } - } - $back_data = substr($back_data, 2); - if($back_data){ //这里 $back_data 还有可能没数据,所以判断一下 - echo $back_data; - }else{ - echo 0; - } - return false; - } - + //$this->BIZ_train_model->auto_add(); + //判断账户余额,如果小于1000自动退出。 + $post_data=array("key"=>$this->key); + $back_data=$this->post_data($this->balance_api,$post_data); + $price = json_decode($back_data)->result; + print_r('账户余额:'.$price); + if($price < 1000){ + exit('账户余额不足'); + } + //筛选出能自动出票的订单 + $auto_pool = $this->BIZ_train_model->auto_check_ticket(); + + //创建一个不允许自动出票的国际火车票数组 + $nation_train = array('K19', 'K23', 'Z8701', 'Z8702', 'Z97', 'Z98', 'Z99', 'Z100', 'K9795'); + + //创建黑名单 + $black_list = $this->config->item('black_list'); + $string = ''; + foreach($auto_pool as $item){ + $this->ticketype = 1; + $back_message = ''; + $cold_sn = $item->COLD_SN; + $coli_id = $item->coli_id; + $back_data = 1; + + $people_arr = $this->BIZ_train_model->biz_people($cold_sn); + $train_info = $this->BIZ_train_model->get_biz_foi($cold_sn); + //print_r($train_info); + if($item->COLD_SPFS > 1){ + //寄送票 + $back_data = 0; + $back_message .= '-邮寄不自动出票'; + } + + //乘客人数大于5人不出票 + if(count($people_arr) > 5){ + $back_data = 0; + $back_message .= '-乘客人数大于5不自动出票'; + } + + //护照号如果在黑名单的就不自动出票 + foreach($people_arr as $people_info){ + if(in_array($people_info->BPE_Passport,$black_list)){ + $back_data = 0; + $back_message .= '-此用户为黑名单用户,不自动出票'; + } + + if(strlen($people_info->BPE_Passport) >= 18){ + $back_data = 0; + $back_message .= '-护照位数大于18不自动出票'; + } + } + + //单张票价不能大于1000人民币 + if($train_info[0]->adultcost > 1000){ + $back_data = 0; + $back_message .= '-单价大于1000不自动出票'; + } + + //如果为国际火车票就不出票 + if(in_array($train_info[0]->FlightsNo, $nation_train)){ + $back_data = 0; + $back_message .= '-国际火车票不自动出票'; + } + + //无座的订单不做出票 + if($train_info[0]->Aircraft == 'WZ'){ + $back_data = 0; + $back_message .= '-无座不自动出票'; + } + + //香港火车不自动出票 + if($train_info[0]->DepartAirport == 'XJA'){ + $back_data = 0; + $back_message .= '-香港火车不自动出票'; + } + + $DepartureDate = strtotime($train_info[0]->DepartureDate); + $time = time(); + $depart_diff = ($DepartureDate - $time) / 86400; + + if($train_info[0]->ArrivalAirport == 'XJA' && $train_info[0]->adultcost > 500 && $depart_diff > 5){ + $back_data = 0; + $back_message .= '-内地香港火车金额大于500超过五天不自动出票'; + } + //print_r($train_info); + + //如果刚好是第三十天的订单 + if(($item->COLI_State == '8' || $item->COLI_State == '63')){ + $this->ticketype = 3; + $time_obj = $this->BIZ_train_model->get_saletime($train_info['0']->DepartAirport_cn); + //print_r($time_obj); + if(!empty($time_obj)){ + $saletime = strtotime($time_obj->TST_saletime); + //echo $saletime; + $sale_diff = (time() - $saletime) / 3600; + if($sale_diff > 1){ + $back_data = 0; + $back_message .= '-超过抢票时间'; + }else if($sale_diff <0){ + $back_data = 0; + $back_message .= '-未到抢票时间'; + } + } + } + + if($back_data == 0){ + $string .= '
序号 | 聚合订单号 | 出票后信息 | 订单原信息 | 是否自动出票 |
---|---|---|---|---|
'.$i.' | '.$item->JOL_JuheOrder.' | '; + if(isset(json_decode($item->JOL_BackTxt)->passengers)){ + $passengers = json_decode($item->JOL_BackTxt)->passengers; + }else{ + $passengers = ''; + } + $ex_obj = ''; + if(!empty($passengers)){ + foreach($passengers as $pass_tiem){ + $ex_obj .= $pass_tiem->cxin; + } + } + if($item->JOL_IsAuto == '1'){ + $item->JOL_IsAuto ='是'; + }else{ + $item->JOL_IsAuto ='否'; + } + $html .= ''.$ex_obj.' | '.$item->FOI_SelectedSeat.' | '.$item->JOL_IsAuto.' |
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 |
-
---|
Train 1:
-Ticket Pick Up No. | -E601014106 | -
---|---|
Train No. | -Z19 | -
Departure | -20:40 Jun.06 Beijing Xi (West) Station(in Chinese 北京西火车站) | -
Arrival | -08:31AM Jun.07 Xi'an Station(in Chinese 西安火车站) | -
Class | -Soft 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.
Dear ,
Thank you for your payment of US$GAI_SQJE?> . The train tickets have already been issued.
You can collect the paper ticket(s) from now on at any train station in mainland China.
Please note:
1.Please present the original passport(s) of all the passenger(s) and the ticket pick-up number(s) ordernumber;?> at ticket collection counters. The counter will then issue your paper train ticket(s).
+See the video about how to collect the ticket(s) in China. +
2.Please double check the train(s) information and passport information. Let us know AT ONCE if you see any mistakes below. We can try to cancel tickets to minimize your loss. A 20% cancellation fee is charged by China Railway.
Ticket collection sentences | The bilingual note below might help you pick up tickets at the ticket collection counter more easily. 1.Please show me which window for picking up the train ticket. 你好,请问哪个是取票窗? 2.Please issue the paper tickets for me. The following is the pick up number(s).请帮我出票,电子取票号如下. |
---|
Passenger(s) | 0){echo $adult.' adult(s) ';} + if($chlid>0){echo $chlid.' chlid(s) ';} + if($baby>0){echo $baby.' baby(s) ';} + ?> BPE_FirstName.$item->BPE_MiddleName.$item->BPE_LastName.' , passport number '.$item->BPE_Passport.' |
---|
3.On your departure day, please time your arrival at the station wisely. If you are going to collect your train ticket(s) on the departure day, allow enough time waiting in the queue of the ticket collection counter, for the security x-ray check of your luggage, and for the ticket check before entering the passenger lounge. Tickets will stop being issued 30 minutes prior to departure. We suggest you be at the station at least 1.5 hours ahead of the stated departure time. Please leave at least 2.5 hours during public holidays.
4.If you’ve already collected your ticket before the departure day, we recommend that you be at the station at least 40 minutes ahead of time. Please be at the station at least 1.5 hours during a public holiday.
5.Please don't throw your ticket(s) away because you'll need it to exit the station.
6.If you cancel the ticket(s) at a train station yourself, the money will be refunded to our account. Please cancel the tickets before the train departure. And email us then we will refund you accordingly.
7.China Highlights train ticket booking policy
Should you have any questions about your train ticket bookings, please do not hesitate to contact me.
+Best Regards!
Name?>, Travel Advisor
Tel: tel;?> Mobile: Mobile;?>
Fax: 86-773-2827424, 86-773-2885308
WeChat: CH_train
Address: Building 6, Chuangyi Business Park, 70 Qilidian Road, Guilin, Guangxi, 541004, China
If you wish to share anything with my supervisor (Ms. ethel), please feel free to send your email to ethel@chinahighlights.net.
diff --git a/application/third_party/train/views/email_before.php b/application/third_party/train/views/email_before.php new file mode 100644 index 00000000..2a077a6c --- /dev/null +++ b/application/third_party/train/views/email_before.php @@ -0,0 +1,48 @@ + +Dear ,
Thanks for payment US$GAI_SQJE?> . The train tickets have already been issued.
You can collect the paper ticket(s) from now at any train station in mainland China.
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.
Please collect your paper tickets from a ticket counter in the train station. Tickets will stop being printed 30 minutes prior to departure. On departure day, please time your arrival wisely. If you are going to collect your tickets on departure day, allow for time waiting in queue at the ticket-counter, for security checks and for ticket checks. We suggest you be at the station at least 1.5 hours ahead of the stated departure time.
If you’ve already collected before the departure day, it is also wise to be at the station at least 40 minutes ahead.
Passenger(s) | 0){echo $adult.' adult(s) ';} + if($chlid>0){echo $chlid.' chlid(s) ';} + if($baby>0){echo $baby.' baby(s) ';} + ?> BPE_FirstName.$item->BPE_MiddleName.$item->BPE_LastName.' , passport number '.$item->BPE_Passport.' |
---|
Ticket Pick Up No. | '; + echo ''.$item->FOI_TrainNetOrderNo.' | '; + echo '
---|---|
Train No. | '; + echo ''.$item->FlightsNo.' |
Departure | '; + echo ''.$item->DepartureTime.' '.$item->DepartureCity.' Station(in Chinese '.$item->DepartAirport_cn.'火车站) |
Arrival | '; + echo ''.$item->ArrivalTime.' '.$item->ArrivalCity.' Station(in Chinese '.$item->ArrivalAirport_cn.'火车站) |
Class | '; + echo ''.$item->Cabin.' |
Kindly note below:
1.Please present all passenger(s) original passport(s) and Ticket Pick Up No.FOI_TrainNetOrderNo?>at any ticket counters of any railway stations. They will then issue your paper train ticket(s). You can find more instruction of collecting tickets enclosure. +
2.You can show screenshot of the paper tickets to the railway station counter. It helps get paper tickets easily.
+'; + echo ''.$obj->DepartAirport_cn.'('.$obj->DepartureCity.')'.$obj->DepartureTime.' To '.$obj->ArrivalAirport_cn.'('.$obj->ArrivalCity.')'.$obj->ArrivalTime.'
'.$people->passengersename.'('.$people->piaotypename.') '; + echo $people->cxin.' 票价:¥'.$people->price.'
'; + echo '出票成功
3. 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 the ticket counter at other stations. Return tickets are treated separately. 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.
4. Please keep your ticket(s) and don't throw your ticket(s) away once you've boarded your train, you'll need it to exit the station.
5.Download railway station instructions, maps and tips at https://www.chinahighlights.com/china-trains/station-map.htm
6.Terms & Conditions. https://www.chinahighlights.com/china-trains/booking-policy.htm
+
Best Regards!
Name?>, Travel Advisor
Tel: tel;?> Mobile: Mobile;?>
Fax: 86-773-2827424, 86-773-2885308
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.
diff --git a/application/third_party/train/views/email_fault.php b/application/third_party/train/views/email_fault.php new file mode 100644 index 00000000..a059912b --- /dev/null +++ b/application/third_party/train/views/email_fault.php @@ -0,0 +1,26 @@ +Dear ,
Thank you for your booking (order number ), we have received your payment of USDGAI_SQJE?>.
Due to the heavy traffic flow of data, the system failed to automatically issue your ticket(s).
Your travel advisor will purchase your train ticket(s) manually. You will receive an email within half a working day (Our time now: , , GMT+8).Should you have any questions or concerns with regards to your train booking, please do not hesitate to contact me at ; or telephone tel;?>.
+'; + echo 'Regards
';
+ echo $operator[0]->Name.'
Travel Advisor
';
+ echo 'Telephone: (Office)'.$operator[0]->tel.', M: '.$operator[0]->Mobile.',';
+ echo 'Email: '.$emailarr[0].';'.$emailarr[1].'; 
Dear ,
Thank you for your payment of US$GAI_SQJE?> . The train tickets have already been issued.
You can collect the paper ticket(s) from now on at any train station in mainland China.
Please note:
1.Please present the original passport(s) of all the passenger(s) and the ticket pick-up number(s) ordernumber;?> at ticket collection counters. The counter will then issue your paper train ticket(s).
+See the video about how to collect the ticket(s) in China. +
2.Please double check the train(s) information and passport information. Let us know AT ONCE if you see any mistakes below. We can try to cancel tickets to minimize your loss. A 20% cancellation fee is charged by China Railway.
Ticket collection sentences | The bilingual note below might help you pick up tickets at the ticket collection counter more easily. 1.Please show me which window for picking up the train ticket. 你好,请问哪个是取票窗? 2.Please issue the paper tickets for me. The following is the pick up number(s).请帮我出票,电子取票号如下. |
---|
Passenger(s) | 0){echo $adult.' adult(s) ';} + if($chlid>0){echo $chlid.' chlid(s) ';} + if($baby>0){echo $baby.' baby(s) ';} + ?> BPE_FirstName.$item->BPE_MiddleName.$item->BPE_LastName.' , passport number '.$item->BPE_Passport.' |
---|
3.On your departure day, please time your arrival at the station wisely. If you are going to collect your train ticket(s) on the departure day, allow enough time waiting in the queue of the ticket collection counter, for the security x-ray check of your luggage, and for the ticket check before entering the passenger lounge. Tickets will stop being issued 30 minutes prior to departure. We suggest you be at the station at least 1.5 hours ahead of the stated departure time. Please leave at least 2.5 hours during public holidays.
4.If you’ve already collected your ticket before the departure day, we recommend that you be at the station at least 40 minutes ahead of time. Please be at the station at least 1.5 hours during a public holiday.
5.Please don't throw your ticket(s) away because you'll need it to exit the station.
6.If you cancel the ticket(s) at a train station yourself, the money will be refunded to our account. Please cancel the tickets before the train departure. And email us then we will refund you accordingly.
7.China Highlights train ticket booking policy
Should you have any questions about your train ticket bookings, please do not hesitate to contact me.
+Best Regards!
Name?>, Travel Advisor
Tel: tel;?> Mobile: Mobile;?>
Fax: 86-773-2827424, 86-773-2885308
WeChat: CH_train
Address: Building 6, Chuangyi Business Park, 70 Qilidian Road, Guilin, Guangxi, 541004, China
If you wish to share anything with my supervisor (Ms. ethel), please feel free to send your email to ethel@chinahighlights.net.
diff --git a/application/third_party/train/views/export20161229.php b/application/third_party/train/views/export20161229.php new file mode 100644 index 00000000..a2433f09 --- /dev/null +++ b/application/third_party/train/views/export20161229.php @@ -0,0 +1,23 @@ ++
Dear ,
Thank you for your interest in China Highlights.
Your account has been created with your phone number :
If you have any questions, please don't hesitate to contact us : https://www.chinahighlights.com/contactus/
Thanks,
The China Highlights Team
+ \ No newline at end of file diff --git a/application/third_party/train/views/train_transaction_excel.php b/application/third_party/train/views/train_transaction_excel.php new file mode 100644 index 00000000..fd45ab3b --- /dev/null +++ b/application/third_party/train/views/train_transaction_excel.php @@ -0,0 +1,178 @@ + + +序号 | +车次 | +座位 | +出发城市 | +抵达城市 | +发车日期 | +发车时间 | +抵达时间 | +票价 | +是否提交过 | +||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ | train[0]->FlightsNo;?> | +train[0]->Cabin;?> | +train[0]->DepartureCity;?> | +train[0]->ArrivalCity;?> | +train[0]->DepartureDate;?> | +train[0]->DepartureTime;?> | +train[0]->ArrivalTime;?> | +train[0]->adultcost;?> | +status)?"否":"是";?> | +||||||||||||||||
+
|
+
序号 | +汉特订单号 | +途牛订单号 | +车次 | +出发 | +到达 | +状态 | +价格 | +提交时间 | +所属部门 | + +||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
+ | COLI_ID;?> | +tol_orderId;?> | +tol_cheCi;?> | +tol_fromStationName;?> | +tol_toStationName;?> | +info;?> | +tol_orderAmount;?> | +tol_subtime;?> | +COLI_WebCode;?> | + + tol_isauto){ + echo '是 | '; + }else{ + echo '否 | '; + } + ?> + tol_sendmail == 1){ + if($v->JOL_M_SN){ + echo '是 | '; + }else{ + echo '是 | '; + } + }else{ + echo '否 | '; + } + ?> +详情 | +
途牛订单号:orderId?> 途牛订单状态:orderStatus?>
+ + +