reply cache
This commit is contained in:
parent
ca4d6cbcd8
commit
5986d89cc5
@ -93,6 +93,8 @@ class Index extends BaseController
|
|||||||
//回帖榜
|
//回帖榜
|
||||||
public function reply()
|
public function reply()
|
||||||
{
|
{
|
||||||
|
$res = Cache::get('reply');
|
||||||
|
if(!$res){
|
||||||
$user = User::withCount('comments')->order(['comments_count'=>'desc','last_login_time'=>'desc'])->limit(20)->select();
|
$user = User::withCount('comments')->order(['comments_count'=>'desc','last_login_time'=>'desc'])->limit(20)->select();
|
||||||
if($user)
|
if($user)
|
||||||
{
|
{
|
||||||
@ -111,6 +113,8 @@ class Index extends BaseController
|
|||||||
$res['data'][] = $u;
|
$res['data'][] = $u;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Cache::set('reply',$res,3600);
|
||||||
|
}
|
||||||
return json($res);
|
return json($res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user