diff --git a/app/index/controller/Common.php b/app/index/controller/Common.php index 28082f3..e289d35 100644 --- a/app/index/controller/Common.php +++ b/app/index/controller/Common.php @@ -54,8 +54,8 @@ class Common extends BaseController $total_hits = Post::cache(60)->sum('hits'); View::assign('total_hits', $total_hits); - $total_week_hits = PostVisit::cache(60)->where('create_time', '>', time() - 86400 * 7)->count(); - $total_day_hits = PostVisit::cache(60)->where('create_time', '>', time() - 86400)->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', '>', strtotime(date('Y-m-d 00:00:00')))->count(); View::assign('total_week_hits', $total_week_hits); View::assign('total_day_hits', $total_day_hits);