|
|
|
@ -47,7 +47,7 @@ class search extends CI_Controller{
|
|
|
|
|
|
|
|
|
|
//我们的接口相应时间
|
|
|
|
|
$responsive_time = $end_time - $this->start_time;
|
|
|
|
|
log_message('error','TRAINSPEED|请求url:'.$this->url.'|聚合相应时间:'.$api_responsive_time.'s|接口运行时间:'.$responsive_time.'s');
|
|
|
|
|
log_message('error','TRAINSPEED|请求url:'.$this->url.'|聚合相应时间:'.$api_responsive_time.'s|接口运行时间:'.$responsive_time.'s|缓存:'.$this->cache.'|+7天:'.$this->seveth);
|
|
|
|
|
print_r($trainjson);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -72,9 +72,16 @@ class search extends CI_Controller{
|
|
|
|
|
|
|
|
|
|
//缓存处理模块(包含缓存处理)
|
|
|
|
|
function dataOperate($search_return,$fromStation,$toStation){
|
|
|
|
|
$this->reason = json_decode($search_return)->reason;
|
|
|
|
|
$this->cache = 'no';
|
|
|
|
|
if(!empty($search_return) && !empty(json_decode($search_return)->result)){
|
|
|
|
|
//首先判断聚合返回的数据是否为空
|
|
|
|
|
if(empty($search_return)){
|
|
|
|
|
$this->reason = '聚合接口没有响应';
|
|
|
|
|
$this->cache = 'yes';
|
|
|
|
|
}else{
|
|
|
|
|
$this->reason = json_decode($search_return)->reason;
|
|
|
|
|
$this->cache = 'no';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!empty(json_decode($search_return)->result)){
|
|
|
|
|
$this->BIZ_train_model->addOrUpdate($fromStation,$toStation,$search_return);
|
|
|
|
|
$operate_data = $search_return;
|
|
|
|
|
}else{
|
|
|
|
|