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();