按照数据库的更新时间对比watertime.xml生成时间

This commit is contained in:
wlx 2010-06-27 03:21:19 +00:00
parent a8caf32509
commit 930cd7a051
1 changed files with 3 additions and 1 deletions

View File

@ -171,7 +171,9 @@ class WaterController extends DataController
function timelineAction() function timelineAction()
{ {
$fn="watertime.xml"; $fn="watertime.xml";
if (!file_exists($fn) || (time()-filemtime($fn)>3600*24)) $rows=$this->db->fetchAll("select ts_created from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' order by ts_created desc limit 1");
$last_update=strtotime($rows[0]['ts_created']);
if (!file_exists($fn) || (filemtime($fn)<$last_update))
{ {
$dateformat="M j Y"; $dateformat="M j Y";
$rows=$this->db->fetchAll("select id,uuid,description,title,timebegin,timeend from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and timebegin is not null order by timebegin"); $rows=$this->db->fetchAll("select id,uuid,description,title,timebegin,timeend from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and timebegin is not null order by timebegin");