From 1ff7aa3be6e09ee58c05db8346b3f77ec973779f Mon Sep 17 00:00:00 2001 From: xiaochong0302 Date: Tue, 29 Dec 2020 15:52:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=B7=E6=96=B0=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E6=8E=A8=E8=8D=90=E8=AF=BE=E7=A8=8B=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Services/Utils/IndexCourseCache.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/Services/Utils/IndexCourseCache.php b/app/Services/Utils/IndexCourseCache.php index 26e279cd..beedbd32 100644 --- a/app/Services/Utils/IndexCourseCache.php +++ b/app/Services/Utils/IndexCourseCache.php @@ -2,8 +2,10 @@ namespace App\Services\Utils; +use App\Caches\IndexFeaturedCourseList as IndexFeaturedCourseListCache; use App\Caches\IndexFreeCourseList as IndexFreeCourseListCache; use App\Caches\IndexNewCourseList as IndexNewCourseListCache; +use App\Caches\IndexSimpleFeaturedCourseList as IndexSimpleFeaturedCourseListCache; use App\Caches\IndexSimpleFreeCourseList as IndexSimpleFreeCourseListCache; use App\Caches\IndexSimpleNewCourseList as IndexSimpleNewCourseListCache; use App\Caches\IndexSimpleVipCourseList as IndexSimpleVipCourseListCache; @@ -19,6 +21,16 @@ class IndexCourseCache extends Service $type = $site['index_tpl_type'] ?: 'full'; + if (!$section || $section == 'featured_course') { + if ($type == 'full') { + $cache = new IndexFeaturedCourseListCache(); + $cache->rebuild(); + } else { + $cache = new IndexSimpleFeaturedCourseListCache(); + $cache->rebuild(); + } + } + if (!$section || $section == 'new_course') { if ($type == 'full') { $cache = new IndexNewCourseListCache();