添加活跃时间

This commit is contained in:
liuwei
2026-01-19 16:42:41 +08:00
parent 99de72a0fb
commit 6629479a66
2 changed files with 22 additions and 0 deletions

View File

@@ -680,3 +680,19 @@ class ContactsDBOperator(BaseDBOperator):
except Exception as e:
self.LOG.error(f"获取所有联系人头像信息失败: {e}")
return []
# 新增更新群成员最后活跃时间接口
def update_chatroom_member_active_time(self, chatroom_id: str, wxid: str) -> bool:
"""更新群成员的最后活跃时间"""
try:
# 只有当成员确实存在时才更新
sql = """
UPDATE t_chatroom_member
SET latest_active_time = CURRENT_TIMESTAMP
WHERE chatroom_id = %s AND wxid = %s
"""
self.execute_update(sql, (chatroom_id, wxid))
return True
except Exception as e:
self.LOG.error(f"更新群{chatroom_id}成员{wxid}活跃时间失败: {e}")
return False