聊天记录从后往前显示
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import os.path
|
||||
import sqlite3
|
||||
import time
|
||||
import threading
|
||||
|
||||
lock = threading.Lock()
|
||||
DB = None
|
||||
cursor = None
|
||||
micromsg_path = "./app/Database/Msg/MicroMsg.db"
|
||||
@@ -27,6 +28,7 @@ def is_database_exist():
|
||||
|
||||
def get_contact():
|
||||
try:
|
||||
lock.acquire(True)
|
||||
sql = '''select UserName,Alias,Type,Remark,NickName,PYInitial,RemarkPYInitial,ContactHeadImgUrl.smallHeadImgUrl,ContactHeadImgUrl.bigHeadImgUrl
|
||||
from Contact inner join ContactHeadImgUrl on Contact.UserName = ContactHeadImgUrl.usrName
|
||||
where Type=3 and Alias is not null
|
||||
@@ -34,15 +36,8 @@ def get_contact():
|
||||
'''
|
||||
cursor.execute(sql)
|
||||
result = cursor.fetchall()
|
||||
except:
|
||||
time.sleep(0.2)
|
||||
sql = '''select UserName,Alias,Type,Remark,NickName,PYInitial,RemarkPYInitial,ContactHeadImgUrl.smallHeadImgUrl,ContactHeadImgUrl.bigHeadImgUrl
|
||||
from Contact inner join ContactHeadImgUrl on Contact.UserName = ContactHeadImgUrl.usrName
|
||||
where Type=3 and Alias is not null
|
||||
order by PYInitial
|
||||
'''
|
||||
cursor.execute(sql)
|
||||
result = cursor.fetchall()
|
||||
finally:
|
||||
lock.release()
|
||||
# DB.commit()
|
||||
return result
|
||||
|
||||
|
||||
Reference in New Issue
Block a user