会话列表 edit

This commit is contained in:
2025-12-03 16:56:33 +08:00
parent c5ae429de1
commit 43f99495ed

View File

@@ -234,13 +234,13 @@ class MessageController extends ApiController
$list_json = Redis::get('usermsg:list:' . $this->user_type . ':' . $this->uid);
if($list_json) {
$list_arr = json_decode($list_json, true);
foreach ($list_arr as $k => $list) {
foreach ($list_arr as $k => &$list) {
if($list['session_id'] == $session_id) {
$list['id_del'] = 1;
$list['is_del'] = 1;
}
}
if(count($list_arr) >= 1) {
Redis::setEx('usermsg:list:' . $this->user_type . ':' . $this->uid, 30 * 86400, json_encode($list_arr));
Redis::set('usermsg:list:' . $this->user_type . ':' . $this->uid, json_encode($list_arr));
}else {
Redis::del('usermsg:list:' . $this->user_type . ':' . $this->uid);
}