$cache=S('newskey'); if(!$cache){ $cache=M('news')->cache(true,60,'newskey')->where('state=1')->order('publishtime desc')->limit(5)->select(); } $this->assign('recentnews',$cache);
$cache=S('newskey'); if(!$cache){ $cache=M('news')->cache(true,60,'newskey')->where('state=1')->order('publishtime desc')->limit(5)->select(); } $this->assign('recentnews',$cache);