fix: explicit row serialization — sqlor rows are objects, not dicts

This commit is contained in:
yumoqing 2026-07-09 13:25:49 +08:00
parent 3a5b9068d9
commit 2438ea6174

View File

@ -12,4 +12,7 @@ async with get_sor_context(env, "tenant") as sor:
recs = await sor.sqlExe("SELECT count(*) as total FROM tenant_domain", {})
total = recs[0].total if recs else 0
recs = await sor.sqlExe("SELECT * FROM tenant_domain ORDER BY created_at desc LIMIT ${pagerows}$ OFFSET ${offset}$", ns)
return {"total": total, "rows": [dict(r) for r in recs]}
rows = []
for r in recs:
rows.append({"id": r.id, "domain": r.domain, "resellerid": r.resellerid, "orgid": r.orgid, "status": r.status, "created_at": str(r.created_at), "updated_at": str(r.updated_at)})
return {"total": total, "rows": rows}