|
|
|
@ -361,7 +361,6 @@ class search extends CI_Controller{
|
|
|
|
|
$all_stations = $this->BIZ_intel_train_model->get_allstations();
|
|
|
|
|
$i = 0;
|
|
|
|
|
foreach($all_stations as $item){
|
|
|
|
|
$rule_arr = $this->BIZ_intel_train_model->get_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;
|
|
|
|
@ -379,8 +378,41 @@ class search extends CI_Controller{
|
|
|
|
|
}
|
|
|
|
|
//print_r($return_json);
|
|
|
|
|
header('Content-type: application/json');
|
|
|
|
|
//print_r(json_encode($return_json));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取国际火车出发规则
|
|
|
|
|
public function ch_station_rules(){
|
|
|
|
|
//获取所有站点的列表
|
|
|
|
|
$return_json = array();
|
|
|
|
|
$return_json['TrainList'] = array();
|
|
|
|
|
$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(!empty($rule_arr)){
|
|
|
|
|
$return_json['TrainList'][$i]['FromStation'] = $item->s_ename;
|
|
|
|
|
$return_json['TrainList'][$i]['FromCountry'] = $item->s_country;
|
|
|
|
|
$return_json['TrainList'][$i]['ToStations'] = array();
|
|
|
|
|
$j = 0;
|
|
|
|
|
foreach($rule_arr as $rule_info){
|
|
|
|
|
$return_json['TrainList'][$i]['ToStations'][$j]['Message'] = $rule_info->tsi_Message;
|
|
|
|
|
$return_json['TrainList'][$i]['ToStations'][$j]['Station'] = $rule_info->S_ename;
|
|
|
|
|
$return_json['TrainList'][$i]['ToStations'][$j]['StationCountry'] = $rule_info->s_country;
|
|
|
|
|
$j++;
|
|
|
|
|
}
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//print_r($return_json);
|
|
|
|
|
header('Content-type: application/json');
|
|
|
|
|
print_r(json_encode($return_json));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取价格(废弃)
|
|
|
|
|
/*
|
|
|
|
|