如下两个用户,分别通过ajax,php查询出的权限菜单(json),如何动态渲染为左侧菜单并加上layui的样式?
用户jay ,user_id=1时的菜单:
SELECT DISTINCT
sm.*
FROM
sys_menu sm,
( SELECT srm.menu_id FROM sys_user_role sur, sys_role_menu srm WHERE sur.role_id = srm.role_id AND sur.user_id = 1 ) t
WHERE
sm.id = t.menu_id
用户Lee ,user_id=2时的菜单:
SELECT DISTINCT
sm.*
FROM
sys_menu sm,
( SELECT srm.menu_id FROM sys_user_role sur, sys_role_menu srm WHERE sur.role_id = srm.role_id AND sur.user_id = 2 ) t
WHERE
sm.id = t.menu_id