From 8a0933cfb66aefafbd2e9c1354d4a00198783c48 Mon Sep 17 00:00:00 2001 From: shuaikangzhou <863909694@qq.com> Date: Fri, 19 Jan 2024 19:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85DisplayContent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/msg.py | 6 +++--- app/ui/chat/chat_info.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/DataBase/msg.py b/app/DataBase/msg.py index 5b25a4f..1d9b807 100644 --- a/app/DataBase/msg.py +++ b/app/DataBase/msg.py @@ -219,7 +219,7 @@ class Msg: def get_message_by_num(self, username_, local_id): sql = ''' - select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent + select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent,DisplayContent from MSG where StrTalker = ? and localId < ? order by CreateTime desc @@ -246,7 +246,7 @@ class Msg: start_time, end_time = time_range if year_ == 'all': sql = f''' - select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent + select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent,DisplayContent from MSG where StrTalker=? and Type=? {'AND CreateTime>' + str(start_time) + ' AND CreateTime<' + str(end_time) if time_range else ''} @@ -260,7 +260,7 @@ class Msg: lock.release() else: sql = ''' - select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent + select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID,BytesExtra,CompressContent,DisplayContent from MSG where StrTalker=? and Type=? and strftime('%Y', CreateTime, 'unixepoch', 'localtime') = ? order by CreateTime diff --git a/app/ui/chat/chat_info.py b/app/ui/chat/chat_info.py index a88232e..6473846 100644 --- a/app/ui/chat/chat_info.py +++ b/app/ui/chat/chat_info.py @@ -166,6 +166,7 @@ class ChatInfo(QWidget): traceback.print_exc() + class ShowChatThread(QThread): showSingal = pyqtSignal(tuple) finishSingal = pyqtSignal(int)