|
|
|
@ -62,8 +62,9 @@ class Tuniu_train extends CI_Controller{
|
|
|
|
|
}';
|
|
|
|
|
$back_data = post_tuniu($url,$post_data,$method = 'POST');
|
|
|
|
|
|
|
|
|
|
log_message('error','tuniutrain 原始数据:'.$back_data);
|
|
|
|
|
//print_r(json_decode($back_data));die();
|
|
|
|
|
$log_info = '';
|
|
|
|
|
//$log_info = '';
|
|
|
|
|
|
|
|
|
|
$tn_info = json_decode($back_data);
|
|
|
|
|
$retrun_code = $tn_info->returnCode;
|
|
|
|
@ -72,13 +73,13 @@ class Tuniu_train extends CI_Controller{
|
|
|
|
|
if(isset($tn_info->data)){
|
|
|
|
|
if(empty(json_decode($back_data)->data)){
|
|
|
|
|
$isCache = true;
|
|
|
|
|
$log_info = 'tuniutrain data缺失|数据源:'.$fromStation.'|'.$toStation.'|'.$date.'|retrun_code:'.$retrun_code.'|return_msg:'.$return_msg;
|
|
|
|
|
//$log_info = 'tuniutrain data缺失|数据源:'.$fromStation.'|'.$toStation.'|'.$date.'|retrun_code:'.$retrun_code.'|return_msg:'.$return_msg;
|
|
|
|
|
}else{
|
|
|
|
|
$this->tuniuprice_model->addOrUpdate($fromStation,$toStation,$back_data);
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
$isCache = true;
|
|
|
|
|
$log_info = 'tuniutrain 接口未响应|数据源:'.$fromStation.'|'.$toStation.'|'.$date.'|retrun_code:'.$retrun_code.'|return_msg:'.$return_msg;
|
|
|
|
|
//$log_info = 'tuniutrain 接口未响应|数据源:'.$fromStation.'|'.$toStation.'|'.$date.'|retrun_code:'.$retrun_code.'|return_msg:'.$return_msg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($isCache){
|
|
|
|
@ -89,12 +90,12 @@ class Tuniu_train extends CI_Controller{
|
|
|
|
|
if(!empty($trainCache)){
|
|
|
|
|
$back_data = $trainCache->tpc_content;
|
|
|
|
|
$isCache = true;
|
|
|
|
|
$log_info .= '|调用缓存';
|
|
|
|
|
log_message('error',$log_info);
|
|
|
|
|
//$log_info .= '|调用缓存';
|
|
|
|
|
//log_message('error',$log_info);
|
|
|
|
|
}else{
|
|
|
|
|
$back_data = null;
|
|
|
|
|
$log_info .= '|缓存为空';
|
|
|
|
|
log_message('error',$log_info);
|
|
|
|
|
//$log_info .= '|缓存为空';
|
|
|
|
|
//log_message('error',$log_info);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|