更新会话列表

This commit is contained in:
2025-12-03 14:29:55 +08:00
parent c4f64e73be
commit 1eb3a46ea2
3 changed files with 26 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ use support\Redis;
class Business
{
// 存消息
// 存消息 未读消息保存30天 30天以后自动删除
public static function setRedisMessage($uid, $user_type, $data, $open_id = '')
{
$str_uid = Base::getUid($uid, $user_type);
@@ -19,11 +19,11 @@ class Business
if($sent) {
$sent = json_decode($sent, true);
$sent[count($sent)] = $set_info_str;
Redis::set($set_str, json_encode($sent));
Redis::setEx($set_str, 30 * 86400, json_encode($sent));
}else {
Redis::set($set_str, json_encode([$set_info_str]));
Redis::setEx($set_str, 30 * 86400, json_encode([$set_info_str]));
}
Redis::set($set_info_str, json_encode($data));
Redis::setEx($set_info_str, 30 * 86400, json_encode($data));
if($open_id) {