脑袋好乱啊,先上传了
This commit is contained in:
@@ -44,11 +44,13 @@ def posts_list():
|
||||
def show_posts_id(posts_id):
|
||||
conn = get_owp_db_conn()
|
||||
sql_posts = "SELECT * FROM posts WHERE status = 1 AND id = ?"
|
||||
sql_message = "SELECT * FROM messages WHERE posts_id = ?"
|
||||
posts = conn.execute(sql_posts, (posts_id,)).fetchone()
|
||||
message = conn.execute(sql_message, (posts_id,)).fetchall()
|
||||
conn.close()
|
||||
if posts is None:
|
||||
return f'未找到该文章{posts_id}<title>未找到该文章{posts_id}</title>', 404
|
||||
return render_template('blog/posts.html', posts=posts)
|
||||
return render_template('blog/posts.html', posts=posts, message=message[::-1])
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user