脑袋好乱啊,先上传了

This commit is contained in:
2025-12-28 23:12:28 +08:00
parent 8ca06abe4a
commit 4266c8ac5c
10 changed files with 179 additions and 147 deletions

View File

@@ -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])