mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
修复统计缓存bug
This commit is contained in:
@@ -54,8 +54,8 @@ class Common extends BaseController
|
|||||||
$total_hits = Post::cache(60)->sum('hits');
|
$total_hits = Post::cache(60)->sum('hits');
|
||||||
View::assign('total_hits', $total_hits);
|
View::assign('total_hits', $total_hits);
|
||||||
|
|
||||||
$total_week_hits = PostVisit::cache(60)->where('create_time', '>', time() - 86400 * 7)->count();
|
$total_week_hits = PostVisit::cache(60)->where('create_time', '>', strtotime(date('Y-m-d 00:00:00')) - 86400 * 7)->count();
|
||||||
$total_day_hits = PostVisit::cache(60)->where('create_time', '>', time() - 86400)->count();
|
$total_day_hits = PostVisit::cache(60)->where('create_time', '>', strtotime(date('Y-m-d 00:00:00')))->count();
|
||||||
View::assign('total_week_hits', $total_week_hits);
|
View::assign('total_week_hits', $total_week_hits);
|
||||||
View::assign('total_day_hits', $total_day_hits);
|
View::assign('total_day_hits', $total_day_hits);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user