|
|
@ -72,9 +72,15 @@ class Tuniu_train extends CI_Controller{
|
|
|
|
if(empty(json_decode($back_data)->data)){
|
|
|
|
if(empty(json_decode($back_data)->data)){
|
|
|
|
$error = json_decode($back_data);
|
|
|
|
$error = json_decode($back_data);
|
|
|
|
$trainCache = $this->tuniuprice_model->get_train_cache($fromStation,$toStation);
|
|
|
|
$trainCache = $this->tuniuprice_model->get_train_cache($fromStation,$toStation);
|
|
|
|
$back_data = $trainCache->tpc_content;
|
|
|
|
if(!empty($trainCache)){
|
|
|
|
$isCache = true;
|
|
|
|
$back_data = $trainCache->tpc_content;
|
|
|
|
log_message('error','tuniutrain 查询出错'.json_decode($back_data));
|
|
|
|
$isCache = true;
|
|
|
|
|
|
|
|
log_message('error','tuniutrain 查询出错|'.$error->errorMsg);
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$back_data = null;
|
|
|
|
|
|
|
|
log_message('error','tuniutrain 缓存为空|'.$fromStation.'|'.$toStation.'|'.$date);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
$this->tuniuprice_model->addOrUpdate($fromStation,$toStation,$back_data);
|
|
|
|
$this->tuniuprice_model->addOrUpdate($fromStation,$toStation,$back_data);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -82,8 +88,12 @@ class Tuniu_train extends CI_Controller{
|
|
|
|
|
|
|
|
|
|
|
|
//途牛数据格式转换
|
|
|
|
//途牛数据格式转换
|
|
|
|
$return_data = new stdClass();
|
|
|
|
$return_data = new stdClass();
|
|
|
|
$return_data->returnCode = json_decode($back_data)->returnCode;
|
|
|
|
if(empty($back_data)){
|
|
|
|
//echo $return_data->returnCode;
|
|
|
|
$return_data->returnCode = '404';
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
$return_data->returnCode = json_decode($back_data)->returnCode;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$return_data->httpstatus = 200;
|
|
|
|
$return_data->httpstatus = 200;
|
|
|
|
$return_data->data = new stdClass();
|
|
|
|
$return_data->data = new stdClass();
|
|
|
|
$return_data->data->seven = $iseven;
|
|
|
|
$return_data->data->seven = $iseven;
|
|
|
|