Skip to content

Commit

Permalink
修改聊天记录显示顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
LC044 committed Nov 17, 2023
1 parent a38550c commit fd8d0ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
29 changes: 11 additions & 18 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/DataBase/msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def get_message_by_num(username_, n):
select localId,TalkerId,Type,SubType,IsSender,CreateTime,Status,StrContent,strftime('%Y-%m-%d %H:%M:%S',CreateTime,'unixepoch','localtime') as StrTime
from MSG
where StrTalker=?
order by CreateTime
order by CreateTime desc
limit 100
'''
result = []
Expand All @@ -71,6 +71,7 @@ def get_message_by_num(username_, n):
cur = cursor[-1]
cur.execute(sql, [username_])
result_ = cur.fetchall()
result_.reverse()
result += result_
return result_
finally:
Expand Down

0 comments on commit fd8d0ed

Please sign in to comment.