Commit a27dbeda authored by ZZH's avatar ZZH

fix qkadmin 2024-03-6

parent f6704c9c
...@@ -83,7 +83,7 @@ async def load_news_pages(news_type, page_num, page_size): ...@@ -83,7 +83,7 @@ async def load_news_pages(news_type, page_num, page_size):
if news_type: if news_type:
sql = "SELECT count(*) FROM official_web.news_info " \ sql = "SELECT count(*) FROM official_web.news_info " \
"WHERE news_type=%s;" "WHERE news_type=%s;"
total = conn.fetch_value(sql, (news_type,)) total = await conn.fetch_value(sql, (news_type,))
sql = f"SELECT id, title, author, news_type, pub_time, top " \ sql = f"SELECT id, title, author, news_type, pub_time, top " \
f"FROM official_web.news_info " \ f"FROM official_web.news_info " \
...@@ -94,7 +94,7 @@ async def load_news_pages(news_type, page_num, page_size): ...@@ -94,7 +94,7 @@ async def load_news_pages(news_type, page_num, page_size):
offsets,)) offsets,))
else: else:
sql = "SELECT count(*) FROM official_web.news_info;" sql = "SELECT count(*) FROM official_web.news_info;"
total = conn.fetch_value(sql) total = await conn.fetch_value(sql)
sql = f"SELECT id, title, author, news_type, pub_time, top " \ sql = f"SELECT id, title, author, news_type, pub_time, top " \
f"FROM official_web.news_info " \ f"FROM official_web.news_info " \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment