添加活跃时间
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user