读取消息记录数

This commit is contained in:
ZhangKang 2023-12-07 11:57:08 +08:00
parent 30e63fadbe
commit 56fe90cd80

View File

@ -58,7 +58,7 @@ class Msg:
sql = ''' sql = '''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID
from MSG from MSG
where TRIM(StrTalker)=? where StrTalker=?
order by CreateTime order by CreateTime
''' '''
try: try:
@ -109,7 +109,7 @@ class Msg:
sql = ''' sql = '''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime
from MSG from MSG
where TRIM(StrTalker) = ? and localId < ? where StrTalker = ? and localId < ?
order by CreateTime desc order by CreateTime desc
limit 10 limit 10
''' '''
@ -133,7 +133,7 @@ class Msg:
sql = ''' sql = '''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID
from MSG from MSG
where TRIM(StrTalker)=? and Type=? where StrTalker=? and Type=?
order by CreateTime order by CreateTime
''' '''
try: try:
@ -150,7 +150,7 @@ class Msg:
sql = ''' sql = '''
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime,MsgSvrID
from MSG from MSG
where TRIM(StrTalker)=? and Type=1 and LENGTH(StrContent)<? and StrContent like ? where StrTalker=? and Type=1 and LENGTH(StrContent)<? and StrContent like ?
order by CreateTime desc order by CreateTime desc
''' '''
temp = [] temp = []
@ -194,7 +194,7 @@ class Msg:
sql = ''' sql = '''
select StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime select StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime
from MSG from MSG
where TRIM(StrTalker)=? where StrTalker=?
order by CreateTime order by CreateTime
limit 1 limit 1
''' '''