更新会话列表
This commit is contained in:
@@ -51,8 +51,6 @@ class ChatMessage extends BaseModel
|
||||
}else {
|
||||
$lastMsg = '';
|
||||
}
|
||||
|
||||
|
||||
if($session['chat_type'] == 1) {
|
||||
$chat_user = Db::name('chat_user')->where(['user_id' => $session['group_id']])->field('nick_name,avatar')->find();
|
||||
$avatar = $chat_user['avatar'];
|
||||
@@ -89,11 +87,30 @@ class ChatMessage extends BaseModel
|
||||
$data[$i]['group_id'] = $group_id;
|
||||
$i ++;
|
||||
}
|
||||
// Redis::set('usermsg:list:' . $user_type . ':' . $uid, json_encode($data));
|
||||
Redis::setEx('usermsg:list:' . $user_type . ':' . $uid, 30 * 86400, json_encode($data));
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
// 更新会话列表
|
||||
public static function updateConverList($uid, $user_type, $session_id)
|
||||
{
|
||||
$is_update = false;
|
||||
$list_json = Redis::get('usermsg:list:' . $user_type . ':' . $uid);
|
||||
if($list_json) {
|
||||
$list_arr = json_decode($list_json, true);
|
||||
foreach ($list_arr as $k => $list) {
|
||||
if($list['session_id'] == $session_id) {
|
||||
$is_update = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if($is_update) {
|
||||
self::getconverlist($uid, $user_type);
|
||||
}
|
||||
}
|
||||
|
||||
public static function getUserIsQuit($uid, $group_id)
|
||||
{
|
||||
// $auit = Db::name('')->where()->find();
|
||||
|
||||
Reference in New Issue
Block a user