From 42a90a9ecf1d528a1de0d1c6bec09327c92f7640 Mon Sep 17 00:00:00 2001 From: xaoyaoo Date: Sat, 3 Aug 2024 18:17:25 +0800 Subject: [PATCH] =?UTF-8?q?get=5Fsession=5Flist=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8E=92=E5=BA=8F=E6=9B=B4=E5=8A=A0=E5=90=88?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywxdump/db/dbMicro.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pywxdump/db/dbMicro.py b/pywxdump/db/dbMicro.py index fec5e0e..a6a5018 100644 --- a/pywxdump/db/dbMicro.py +++ b/pywxdump/db/dbMicro.py @@ -31,6 +31,7 @@ class MicroHandler(DatabaseBase): # 为 Session 表添加索引 self.execute("CREATE INDEX IF NOT EXISTS idx_Session_strUsrName_nTime ON Session(strUsrName, nTime);") self.execute("CREATE INDEX IF NOT EXISTS idx_Session_nOrder ON Session(nOrder);") + self.execute("CREATE INDEX IF NOT EXISTS idx_Session_nTime ON Session(nTime);") # 为 Contact 表添加索引 self.execute("CREATE INDEX IF NOT EXISTS idx_Contact_UserName ON Contact(UserName);") @@ -85,7 +86,7 @@ class MicroHandler(DatabaseBase): "left join Contact C ON C.UserName = S.strUsrName " "LEFT JOIN ContactHeadImgUrl H ON C.UserName = H.usrName " "WHERE S.strUsrName!='@publicUser' " - "ORDER BY S.nOrder DESC;" + "ORDER BY S.nTime DESC;" ) ret = self.execute(sql) if not ret: