31 lines
809 B
Plaintext
31 lines
809 B
Plaintext
sql = """select a.id, a.username, e.org_type, e.role, d.path
|
|
from users a left join userrole b on a.id = b.userid
|
|
left join rolepermission c on c.roleid = b.roleid
|
|
left join permission d on d.id = c.permid
|
|
left join role e on e.id = b.roleid
|
|
where a.username = 'kyy_销售'
|
|
and a.del_flg = '0'
|
|
and b.del_flg = '0'
|
|
and c.del_flg = '0'
|
|
and d.del_flg = '0'
|
|
and e.del_flg = '0'
|
|
and a.user_status = '0'
|
|
"""
|
|
if not params_kw.get('username'):
|
|
return 'need a username parameter'
|
|
|
|
db = DBPools()
|
|
ns = params_kw.copy()
|
|
if not ns.get('page'):
|
|
ns['page'] = 1
|
|
if not ns.get('rows'):
|
|
ns['rows'] = 100
|
|
|
|
if not ns.get('sort'):
|
|
ns['sort'] = ['path']
|
|
|
|
async with db.sqlorContext('kboss') as sor:
|
|
rec = await sor.sqlPaging(sql, ns.copy())
|
|
return rec
|
|
return ns
|