mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-07-08 09:49:49 +08:00
* 去除无用的auth_url * 修改readme * 修复计划任务生成sitemap.xml失败问题 * 增加课程推荐 * 增加后台刷新首页缓存小工具 * 调整公众号模板消息 * 增加刷新首页推荐课程缓存逻辑 * 更新课程综合评分算法 * 修复在线用户并发重复记录问题 * 增加限制共享帐号功能 * 修复数据迁移中无符号整型问题 * 更新版本为v1.2.3
65 lines
2.1 KiB
PHP
65 lines
2.1 KiB
PHP
<?php
|
|
|
|
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;
|
|
use App\Caches\IndexVipCourseList as IndexVipCourseListCache;
|
|
use App\Services\Service;
|
|
|
|
class IndexCourseCache extends Service
|
|
{
|
|
|
|
public function rebuild($section = null)
|
|
{
|
|
$site = $this->getSettings('site');
|
|
|
|
$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();
|
|
$cache->rebuild();
|
|
} else {
|
|
$cache = new IndexSimpleNewCourseListCache();
|
|
$cache->rebuild();
|
|
}
|
|
}
|
|
|
|
if (!$section || $section == 'free_course') {
|
|
if ($type == 'full') {
|
|
$cache = new IndexFreeCourseListCache();
|
|
$cache->rebuild();
|
|
} else {
|
|
$cache = new IndexSimpleFreeCourseListCache();
|
|
$cache->rebuild();
|
|
}
|
|
}
|
|
|
|
if (!$section || $section == 'vip_course') {
|
|
if ($type == 'full') {
|
|
$cache = new IndexVipCourseListCache();
|
|
$cache->rebuild();
|
|
} else {
|
|
$cache = new IndexSimpleVipCourseListCache();
|
|
$cache->rebuild();
|
|
}
|
|
}
|
|
}
|
|
|
|
} |