public function index() { if(Cache::get('category')) { $tree = Cache::get('category'); } else{ $tree = $this->getCate(); Cache::set('category',$tree,3600*24); } $this->assign('tree',$tree); return view(); }
转载于:https://my.oschina.net/u/3483680/blog/1824049