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

18 lines
529 B
Plaintext

async def delRole(ns):
"""
删除角色
:param id: 角色id
:return:
"""
db = DBPools()
async with db.sqlorContext('kboss') as sor:
if ns:
ns['del_flg'] = '1'
await sor.U('role', ns)
sql = """ update userrole set del_flg = '1' WHERE roleid = ${id}$ """
await sor.sqlExe(sql,{'id':ns['id']})
return {'status': True, 'msg': '删除成功'}
return {'status': False, 'msg': '删除失败'}
ret = await delRole(params_kw)
return ret