rbac/wwwroot/codes/get_kvs.dspy
2024-03-12 18:46:05 +08:00

18 lines
418 B
Plaintext

ns = params_kw.copy()
if not ns.get('page'):
ns['page'] = 1
if not ns.get('sort'):
ns['sort'] = 'k'
print(f'{ns=}, get_kvs.dspy')
dbname = get_definition('codesdb')
print(f'dbname=', dbname)
db = DBPools()
async with db.sqlorContext(dbname) as sor:
sql = "select *, $[hierarchy_flg]$ as hierarchy_flg from appcodes_kv where del_flg='0' and parentid=${pid}$"
r = await sor.sqlPaging(sql, ns)
return r
return {
}