From 9b29c5c67ae358674a4d08b3c99a88406c573a88 Mon Sep 17 00:00:00 2001 From: augushong Date: Wed, 28 Jun 2023 14:34:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=9F=E8=AE=A1=E7=BC=93?= =?UTF-8?q?=E5=AD=98bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Common.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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);