|
|
|
@ -372,17 +372,20 @@ class search extends CI_Controller{
|
|
|
|
|
$all_stations = $this->BIZ_intel_train_model->get_allstations();
|
|
|
|
|
$i = 0;
|
|
|
|
|
foreach($all_stations as $item){
|
|
|
|
|
$return_json['TrainList'][$i]['FromStation'] = $item->s_ename.','.$item->s_country;
|
|
|
|
|
$return_json['TrainList'][$i]['ToStations'] = array();
|
|
|
|
|
$rule_arr = $this->BIZ_intel_train_model->get_train_rules($item->station_id);
|
|
|
|
|
$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.','.$item->s_country;
|
|
|
|
|
$j++;
|
|
|
|
|
if(!empty($rule_arr)){
|
|
|
|
|
$return_json['TrainList'][$i]['FromStation'] = $item->s_ename.','.$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.','.$item->s_country;
|
|
|
|
|
$j++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$i++;
|
|
|
|
|
}
|
|
|
|
|
//print_r($return_json);
|
|
|
|
|
header('Content-type: application/json');
|
|
|
|
|