1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-07-19 22:52:59 +08:00
course-tencent-cloud/app/Caches/MaxImChatGroupId.php
2020-06-21 19:27:23 +08:00

30 lines
490 B
PHP

<?php
namespace App\Caches;
use App\Models\ImChatGroup as ImChatGroupModel;
class MaxImChatGroupId extends Cache
{
protected $lifetime = 365 * 86400;
public function getLifetime()
{
return $this->lifetime;
}
public function getKey($id = null)
{
return 'max_im_chat_group_id';
}
public function getContent($id = null)
{
$group = ImChatGroupModel::findFirst(['order' => 'id DESC']);
return $group->id ?? 0;
}
}