update database sql query
This commit is contained in:
12
database.py
12
database.py
@@ -178,16 +178,12 @@ PRIMARY KEY (hash)
|
|||||||
def getRSSListByChatId(self, chatId: int) -> List[RSSEntry]:
|
def getRSSListByChatId(self, chatId: int) -> List[RSSEntry]:
|
||||||
with self._value_lock:
|
with self._value_lock:
|
||||||
cur = self._db.execute(
|
cur = self._db.execute(
|
||||||
f"SELECT * FROM chatList WHERE chatId={chatId}")
|
f"SELECT RSSList.title, RSSList.url, RSSList.interval, RSSList.lastupdatetime, RSSList.id, chatList.config FROM RSSList, chatList WHERE chatList.chatId = {chatId} AND RSSList.id = chatList.id ORDER BY title")
|
||||||
RSSEntries = []
|
RSSEntries = []
|
||||||
for i in cur:
|
for i in cur:
|
||||||
chatEntry = ChatEntry(i)
|
rssEntry = RSSEntry(i, self._main._setting._maxCount)
|
||||||
cur = self._db.execute(
|
rssEntry.chatList.append(ChatEntry((chatId, i[4], i[5])))
|
||||||
f"SELECT * FROM RSSList WHERE id='{chatEntry.id}'")
|
RSSEntries.append(rssEntry)
|
||||||
for k in cur:
|
|
||||||
rssEntry = RSSEntry(k, self._main._setting._maxCount)
|
|
||||||
rssEntry.chatList.append(chatEntry)
|
|
||||||
RSSEntries.append(rssEntry)
|
|
||||||
return RSSEntries
|
return RSSEntries
|
||||||
|
|
||||||
def getUserStatus(self, userId: int) -> (userStatus, str):
|
def getUserStatus(self, userId: int) -> (userStatus, str):
|
||||||
|
|||||||
Reference in New Issue
Block a user