1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-27 21:10:24 +08:00
xiaochong0302 93b0071c87 去掉第三方登录
增强关闭交易健壮性
去除.phalcon目录
2020-04-18 19:51:43 +08:00

32 lines
495 B
PHP

<?php
namespace App\Caches;
use App\Repos\Category as CategoryRepo;
class Category extends Cache
{
protected $lifetime = 365 * 86400;
public function getLifetime()
{
return $this->lifetime;
}
public function getKey($id = null)
{
return "category:{$id}";
}
public function getContent($id = null)
{
$categoryRepo = new CategoryRepo();
$category = $categoryRepo->findById($id);
return $category ?: null;
}
}