避免没有数据的情况

hotfix/远程访问多媒体中心
cyc 7 years ago
parent 4918a9c081
commit 62662d08e8

@ -59,15 +59,21 @@ class BIZ_train_model extends CI_Model {
AND AND
tpc_to_station = '$tpc_to_station'"; tpc_to_station = '$tpc_to_station'";
$query = $this->INFO->query($sql); $query = $this->INFO->query($sql);
$cache_time = strtotime($query->row()->tpc_datetime);
$now_time = time(); if($query->row()){
$differ_time = ($now_time - $cache_time) / 86400; $cache_time = strtotime($query->row()->tpc_datetime);
if($differ_time >= 7){ $now_time = time();
$this->delete_traincache($tpc_from_station,$tpc_to_station); $differ_time = ($now_time - $cache_time) / 86400;
return null; if($differ_time >= 7){
$this->delete_traincache($tpc_from_station,$tpc_to_station);
return null;
}else{
return $query->row();
}
}else{ }else{
return $query->row(); return null;
} }
} }
//删除缓存操作 //删除缓存操作

Loading…
Cancel
Save