try: db = DBPools() post_id = params_kw.get('post_id', '') async with db.sqlorContext('sage') as sor: # 获取评论列表(含嵌套回复) comments = await sor.sqlExe( """SELECT c.*, (SELECT COUNT(*) FROM showcase_likes WHERE post_id = c.id) as c_like FROM showcase_comments c WHERE c.post_id = ${post_id}$ AND c.status = '1' ORDER BY c.created_at ASC""", {"post_id": post_id} ) return json.dumps({"status": "ok", "data": list(comments)}, ensure_ascii=False) except Exception as e: return json.dumps({"status": "error", "data": [], "message": str(e)}, ensure_ascii=False)