kboss/b/role/getuserroles.dspy
2025-07-16 14:27:17 +08:00

19 lines
591 B
Plaintext

async def getuserroles(ns):
"""用户角色查询"""
db = DBPools()
async with db.sqlorContext('kboss') as sor:
if ns:
ns['del_flg'] = '0'
reacs = await sor.R('userrole', ns)
for i in reacs:
ns['id'] = i['roleid']
role = await sor.R('role', ns)
if len(role) >= 1:
i['roleid'] = role[0]
continue
return {'status': True, 'data': reacs}
return {'status': False, 'msg': '参数错误'}
ret = await getuserroles(params_kw)
return ret