SVN-Revision: r498
This commit is contained in:
wyf
2025-04-18 04:04:04 +00:00
parent 4f4b091c78
commit 7d064e9555
+20 -3
View File
@@ -1034,9 +1034,26 @@ namespace Lskj.Business.Impl
where = " and isnull(menutype,0)=0";
break;
}
string sqlValue = string.Format("select * from P_systempopupmenu where isnull(visible,0)=0 and (isnull(privilegeOper,'')='' or charindex(',{0},',','+privilegeOper+',')>0) and tab=@tab ", ERPInfo.Instance.UserName) + where + " order by orderid";
return SqlHelper.ExecuteDataTable(sqlValue, new SqlParameter[] { new SqlParameter("@tab", key) });
string sqlTemplate = @"WITH UserRoles AS (
SELECT r.roleName
FROM p_systemRoleOperSetTab AS ro
JOIN p_systemRoleSetTab AS r ON r.id = ro.roleId
WHERE ro.operatorname = '{0}'
)
SELECT pm.*
FROM P_systempopupmenu AS pm WITH (NOLOCK)
WHERE ISNULL(pm.visible, 0) = 0
AND pm.tab = '{1}'
AND (
ISNULL(pm.privilegeOper, '') = ''
OR CHARINDEX(',' + '{0}' + ',', ',' + pm.privilegeOper + ',') > 0
OR EXISTS (
SELECT 1
FROM UserRoles AS ur
WHERE CHARINDEX('{{&' + ur.roleName + '&}}', pm.privilegeOper) > 0)
) {2} ORDER BY pm.orderid;";
string sqlValue = string.Format(sqlTemplate, ERPInfo.Instance.UserName, key, where);
return SqlHelper.ExecuteDataTable(sqlValue);
}
/// <summary>
/// 获取单个右键菜单