修改自动出票接口

hotfix/远程访问多媒体中心
cyc 6 years ago
parent 5348756365
commit 9c17a87671

@ -392,11 +392,10 @@ class search extends CI_Controller{
$all_stations = $this->BIZ_intel_train_model->ch_allstations(); $all_stations = $this->BIZ_intel_train_model->ch_allstations();
$i = 0; $i = 0;
foreach($all_stations as $item){ foreach($all_stations as $item){
if($item->s_country == 'Vietnam'){ if($item->s_country == 'China'){
$rule_arr = $this->BIZ_intel_train_model->ch_train_rules($item->station_id,true); $rule_arr = $this->BIZ_intel_train_model->ch_train_rules($item->station_id);
}else{
$rule_arr = $this->BIZ_intel_train_model->ch_train_rules($item->station_id,false);
} }
if(!empty($rule_arr)){ if(!empty($rule_arr)){
$return_json['TrainList'][$i]['FromStation'] = $item->s_ename; $return_json['TrainList'][$i]['FromStation'] = $item->s_ename;
$return_json['TrainList'][$i]['FromCountry'] = $item->s_country; $return_json['TrainList'][$i]['FromCountry'] = $item->s_country;

@ -126,7 +126,7 @@ class BIZ_intel_train_model extends CI_Model {
} }
public function ch_allstations(){ 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); $query = $this->HT->query($sql);
return $query->result(); return $query->result();
} }
@ -146,31 +146,25 @@ class BIZ_intel_train_model extends CI_Model {
return $query->result(); return $query->result();
} }
public function ch_train_rules($station_id,$flag){ public function ch_train_rules($station_id){
if($flag){
$and = "and s_country != 'Vietnam'";
}else{
$and = "";
}
if($station_id == 11){ if($station_id == 11){
$station = "or tsi_FromStation = 10"; $station = "or tsi_FromStation = 10 or tsi_ToStation = 10";
}else{ }else{
$station = ""; $station = "";
} }
$sql = "SELECT $sql = "SELECT
S_ename,s_country,tsi_Message S_ename,s_country,tsi_Message
FROM FROM
TrainSearch_intel [syn123] .tourmanager. dbo.TrainSearch_intel
LEFT JOIN LEFT JOIN
TrainStation_intel [syn123] .tourmanager. dbo.TrainStation_intel
ON ON
tsi_ToStation = station_id tsi_ToStation = station_id
where where
tsi_FromStation = '{$station_id}' (tsi_FromStation = ? or tsi_ToStation = ?)
"; ";
$sql .= $and;
$sql .= $station; $sql .= $station;
$query = $this->HT->query($sql); $query = $this->HT->query($sql,array($station_id,$station_id));
return $query->result(); return $query->result();
} }
} }

@ -140,7 +140,7 @@ class addorders extends CI_Controller{
}else{ }else{
//单个订单提交 //单个订单提交
echo $cold_sn.'<br>'; echo $cold_sn.'<br>';
$this->booktickets($cold_sn,$bpe_sn,'','juhe'); $this->booktickets($cold_sn,$bpe_sn,'','ctrip');
//$string .= '<tr><td>汉特订单号:'.$coli_id.'('.$cold_sn.')可以自动出票</td></tr>'; //$string .= '<tr><td>汉特订单号:'.$coli_id.'('.$cold_sn.')可以自动出票</td></tr>';
} }
} }

Loading…
Cancel
Save