优化返回内容
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
微信联系人数据库操作类
|
微信联系人数据库操作类
|
||||||
用于管理微信联系人信息的存储和查询
|
用于管理微信联系人信息的存储和查询
|
||||||
"""
|
"""
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
import json
|
import json
|
||||||
@@ -615,6 +616,11 @@ class ContactsDBOperator(BaseDBOperator):
|
|||||||
try:
|
try:
|
||||||
sql = "SELECT wxid,nick_name,display_name,status,latest_active_time FROM t_chatroom_member WHERE chatroom_id = %s"
|
sql = "SELECT wxid,nick_name,display_name,status,latest_active_time FROM t_chatroom_member WHERE chatroom_id = %s"
|
||||||
results = self.execute_query(sql, (chatroom_id,))
|
results = self.execute_query(sql, (chatroom_id,))
|
||||||
|
|
||||||
|
for row in results:
|
||||||
|
dt = row.get("latest_active_time")
|
||||||
|
if isinstance(dt, datetime):
|
||||||
|
row["latest_active_time"] = dt.strftime("%Y-%m-%d %H:%M:%S")
|
||||||
return results
|
return results
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.LOG.error(f"获取群{chatroom_id}成员列表失败: {e}")
|
self.LOG.error(f"获取群{chatroom_id}成员列表失败: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user