From 9c17a8767179971a15e05ef3fe3d8cf9f6b36299 Mon Sep 17 00:00:00 2001 From: cyc Date: Wed, 10 Jul 2019 16:45:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E5=8A=A8=E5=87=BA?= =?UTF-8?q?=E7=A5=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third_party/train/controllers/search.php | 7 +++---- .../train/models/BIZ_intel_train_model.php | 20 +++++++------------ .../trainsystem/controllers/addorders.php | 2 +- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/application/third_party/train/controllers/search.php b/application/third_party/train/controllers/search.php index 5530e411..105e6728 100644 --- a/application/third_party/train/controllers/search.php +++ b/application/third_party/train/controllers/search.php @@ -392,11 +392,10 @@ class search extends CI_Controller{ $all_stations = $this->BIZ_intel_train_model->ch_allstations(); $i = 0; foreach($all_stations as $item){ - if($item->s_country == 'Vietnam'){ - $rule_arr = $this->BIZ_intel_train_model->ch_train_rules($item->station_id,true); - }else{ - $rule_arr = $this->BIZ_intel_train_model->ch_train_rules($item->station_id,false); + if($item->s_country == 'China'){ + $rule_arr = $this->BIZ_intel_train_model->ch_train_rules($item->station_id); } + if(!empty($rule_arr)){ $return_json['TrainList'][$i]['FromStation'] = $item->s_ename; $return_json['TrainList'][$i]['FromCountry'] = $item->s_country; diff --git a/application/third_party/train/models/BIZ_intel_train_model.php b/application/third_party/train/models/BIZ_intel_train_model.php index a659a6d9..509b0fd8 100644 --- a/application/third_party/train/models/BIZ_intel_train_model.php +++ b/application/third_party/train/models/BIZ_intel_train_model.php @@ -126,7 +126,7 @@ class BIZ_intel_train_model extends CI_Model { } public function ch_allstations(){ - $sql = "SELECT * FROM TrainStation_intel where station_id != 10"; + $sql = "SELECT * FROM [syn123] .tourmanager. dbo.TrainStation_intel where station_id != 10"; $query = $this->HT->query($sql); return $query->result(); } @@ -146,31 +146,25 @@ class BIZ_intel_train_model extends CI_Model { return $query->result(); } - public function ch_train_rules($station_id,$flag){ - if($flag){ - $and = "and s_country != 'Vietnam'"; - }else{ - $and = ""; - } + public function ch_train_rules($station_id){ if($station_id == 11){ - $station = "or tsi_FromStation = 10"; + $station = "or tsi_FromStation = 10 or tsi_ToStation = 10"; }else{ $station = ""; } $sql = "SELECT S_ename,s_country,tsi_Message FROM - TrainSearch_intel + [syn123] .tourmanager. dbo.TrainSearch_intel LEFT JOIN - TrainStation_intel + [syn123] .tourmanager. dbo.TrainStation_intel ON tsi_ToStation = station_id where - tsi_FromStation = '{$station_id}' + (tsi_FromStation = ? or tsi_ToStation = ?) "; - $sql .= $and; $sql .= $station; - $query = $this->HT->query($sql); + $query = $this->HT->query($sql,array($station_id,$station_id)); return $query->result(); } } diff --git a/application/third_party/trainsystem/controllers/addorders.php b/application/third_party/trainsystem/controllers/addorders.php index 8a0602f6..814309da 100644 --- a/application/third_party/trainsystem/controllers/addorders.php +++ b/application/third_party/trainsystem/controllers/addorders.php @@ -140,7 +140,7 @@ class addorders extends CI_Controller{ }else{ //单个订单提交 echo $cold_sn.'
'; - $this->booktickets($cold_sn,$bpe_sn,'','juhe'); + $this->booktickets($cold_sn,$bpe_sn,'','ctrip'); //$string .= '汉特订单号:'.$coli_id.'('.$cold_sn.')可以自动出票'; } }