1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-27 13:00:23 +08:00
xiaochong0302 0342331d89 1.重命名kg_img_url
2.调整错误页
3.模拟topic数据
2020-04-12 17:27:33 +08:00

38 lines
595 B
PHP

<?php
namespace App\Caches;
use App\Repos\Course as CourseRepo;
class Course extends Cache
{
protected $lifetime = 7 * 86400;
public function getLifetime()
{
return $this->lifetime;
}
public function getKey($id = null)
{
return "course:{$id}";
}
public function getContent($id = null)
{
$courseRepo = new CourseRepo();
$course = $courseRepo->findById($id);
$course->cover = kg_ci_img_url($course->cover);
if (!$course) {
return new \stdClass();
}
return $course;
}
}