From 56f909b5d29173a7e155771727ab7c5303c46b44 Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Mon, 11 Dec 2023 17:47:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=A8=E8=8D=90=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=E7=BC=93=E5=AD=98=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Caches/FeaturedArticleList.php | 6 ++---- app/Caches/FeaturedCourseList.php | 10 ++++------ app/Caches/FeaturedQuestionList.php | 6 ++---- app/Http/Admin/Views/answer/search.volt | 7 ------- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/app/Caches/FeaturedArticleList.php b/app/Caches/FeaturedArticleList.php index 61d718e2..86507ebe 100644 --- a/app/Caches/FeaturedArticleList.php +++ b/app/Caches/FeaturedArticleList.php @@ -14,13 +14,11 @@ use Phalcon\Mvc\Model\ResultsetInterface; class FeaturedArticleList extends Cache { - protected $lifetime = 86400; + protected $lifetime = 3600; public function getLifetime() { - $tomorrow = strtotime('tomorrow'); - - return $tomorrow - time(); + return $this->lifetime; } public function getKey($id = null) diff --git a/app/Caches/FeaturedCourseList.php b/app/Caches/FeaturedCourseList.php index 8243ce1d..c5c05c58 100644 --- a/app/Caches/FeaturedCourseList.php +++ b/app/Caches/FeaturedCourseList.php @@ -14,13 +14,11 @@ use Phalcon\Mvc\Model\ResultsetInterface; class FeaturedCourseList extends Cache { - protected $lifetime = 86400; + protected $lifetime = 3600; public function getLifetime() { - $tomorrow = strtotime('tomorrow'); - - return $tomorrow - time(); + return $this->lifetime; } public function getKey($id = null) @@ -30,7 +28,7 @@ class FeaturedCourseList extends Cache public function getContent($id = null) { - $limit = 8; + $limit = 5; $courses = $this->findCourses($limit); @@ -71,7 +69,7 @@ class FeaturedCourseList extends Cache * @param int $limit * @return ResultsetInterface|Resultset|CourseModel[] */ - protected function findCourses($limit = 8) + protected function findCourses($limit = 5) { return CourseModel::query() ->where('featured = 1') diff --git a/app/Caches/FeaturedQuestionList.php b/app/Caches/FeaturedQuestionList.php index bbb599fb..9a64b958 100644 --- a/app/Caches/FeaturedQuestionList.php +++ b/app/Caches/FeaturedQuestionList.php @@ -14,13 +14,11 @@ use Phalcon\Mvc\Model\ResultsetInterface; class FeaturedQuestionList extends Cache { - protected $lifetime = 86400; + protected $lifetime = 3600; public function getLifetime() { - $tomorrow = strtotime('tomorrow'); - - return $tomorrow - time(); + return $this->lifetime; } public function getKey($id = null) diff --git a/app/Http/Admin/Views/answer/search.volt b/app/Http/Admin/Views/answer/search.volt index 198944c4..945fb5d7 100644 --- a/app/Http/Admin/Views/answer/search.volt +++ b/app/Http/Admin/Views/answer/search.volt @@ -42,13 +42,6 @@ {% endfor %} -
- -
- - -
-