mirror of
https://gitee.com/koogua/course-tencent-cloud.git
synced 2025-06-26 12:23:06 +08:00
调整推荐课程缓存时间
This commit is contained in:
parent
6cee04917c
commit
3e08ad8dcb
@ -14,13 +14,11 @@ use Phalcon\Mvc\Model\ResultsetInterface;
|
||||
class FeaturedArticleList extends Cache
|
||||
{
|
||||
|
||||
protected $lifetime = 86400;
|
||||
protected $lifetime = 3600;
|
||||
|
||||
public function getLifetime()
|
||||
{
|
||||
$tomorrow = strtotime('tomorrow');
|
||||
|
||||
return $tomorrow - time();
|
||||
return $this->lifetime;
|
||||
}
|
||||
|
||||
public function getKey($id = null)
|
||||
|
@ -14,13 +14,11 @@ use Phalcon\Mvc\Model\ResultsetInterface;
|
||||
class FeaturedCourseList extends Cache
|
||||
{
|
||||
|
||||
protected $lifetime = 86400;
|
||||
protected $lifetime = 3600;
|
||||
|
||||
public function getLifetime()
|
||||
{
|
||||
$tomorrow = strtotime('tomorrow');
|
||||
|
||||
return $tomorrow - time();
|
||||
return $this->lifetime;
|
||||
}
|
||||
|
||||
public function getKey($id = null)
|
||||
@ -30,7 +28,7 @@ class FeaturedCourseList extends Cache
|
||||
|
||||
public function getContent($id = null)
|
||||
{
|
||||
$limit = 8;
|
||||
$limit = 5;
|
||||
|
||||
$courses = $this->findCourses($limit);
|
||||
|
||||
@ -71,7 +69,7 @@ class FeaturedCourseList extends Cache
|
||||
* @param int $limit
|
||||
* @return ResultsetInterface|Resultset|CourseModel[]
|
||||
*/
|
||||
protected function findCourses($limit = 8)
|
||||
protected function findCourses($limit = 5)
|
||||
{
|
||||
return CourseModel::query()
|
||||
->where('featured = 1')
|
||||
|
@ -14,13 +14,11 @@ use Phalcon\Mvc\Model\ResultsetInterface;
|
||||
class FeaturedQuestionList extends Cache
|
||||
{
|
||||
|
||||
protected $lifetime = 86400;
|
||||
protected $lifetime = 3600;
|
||||
|
||||
public function getLifetime()
|
||||
{
|
||||
$tomorrow = strtotime('tomorrow');
|
||||
|
||||
return $tomorrow - time();
|
||||
return $this->lifetime;
|
||||
}
|
||||
|
||||
public function getKey($id = null)
|
||||
|
@ -42,13 +42,6 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">匿名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="anonymous" value="1" title="是">
|
||||
<input type="radio" name="anonymous" value="0" title="否">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">删除</label>
|
||||
<div class="layui-input-block">
|
||||
|
Loading…
x
Reference in New Issue
Block a user