1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-03 07:26:49 +08:00
2020-04-20 19:21:29 +08:00

36 lines
560 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);
if (!$course) return null;
$course->cover = kg_ci_img_url($course->cover);
return $course;
}
}