From 56fe90cd80f9b2e6df4cf75adbf4f51c0690a0ac Mon Sep 17 00:00:00 2001 From: ZhangKang Date: Thu, 7 Dec 2023 11:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=B6=88=E6=81=AF=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/msg.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/DataBase/msg.py b/app/DataBase/msg.py index 6d8c66d..915efa7 100644 --- a/app/DataBase/msg.py +++ b/app/DataBase/msg.py @@ -58,7 +58,7 @@ class Msg: sql = ''' select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID from MSG - where TRIM(StrTalker)=? + where StrTalker=? order by CreateTime ''' try: @@ -109,7 +109,7 @@ class Msg: sql = ''' select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime from MSG - where TRIM(StrTalker) = ? and localId < ? + where StrTalker = ? and localId < ? order by CreateTime desc limit 10 ''' @@ -133,7 +133,7 @@ class Msg: sql = ''' select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID from MSG - where TRIM(StrTalker)=? and Type=? + where StrTalker=? and Type=? order by CreateTime ''' try: @@ -150,7 +150,7 @@ class Msg: sql = ''' select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID from MSG - where TRIM(StrTalker)=? and Type=1 and LENGTH(StrContent)