Skip to content

Commit

Permalink
feat:contact order by pingying
Browse files Browse the repository at this point in the history
  • Loading branch information
Twelveeee committed Dec 4, 2023
1 parent d01cea2 commit ce909e5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/DataBase/micro_msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,16 @@ def get_contact(self):
return None
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%2=1 and Alias is not null
order by PYInitial
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 % 2 = 1
AND NickName != ''
ORDER BY
CASE
WHEN RemarkPYInitial = '' THEN PYInitial
ELSE RemarkPYInitial
END ASC
'''
self.cursor.execute(sql)
result = self.cursor.fetchall()
Expand Down

0 comments on commit ce909e5

Please sign in to comment.