From 6eefbae5fef88f999a468ce67829e2c1e71b9859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Thu, 13 Apr 2023 06:38:39 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=8E=B7=E5=8F=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=A7=92=E8=89=B2=E5=88=97=E8=A1=A8=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=B7=B2=E5=88=A0=E9=99=A4=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Service/System/SysRoleService.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ZR.Service/System/SysRoleService.cs b/ZR.Service/System/SysRoleService.cs index 54da378..86050c9 100644 --- a/ZR.Service/System/SysRoleService.cs +++ b/ZR.Service/System/SysRoleService.cs @@ -276,10 +276,11 @@ namespace ZR.Service /// public List SelectUserRoleListByUserId(long userId) { - return Context.Queryable((ur, r) => new JoinQueryInfos( - JoinType.Left, ur.RoleId == r.RoleId - )).Where((ur, r) => ur.UserId == userId) - .Select((ur, r) => r).ToList(); + return Context.Queryable() + .LeftJoin((ur, r) => ur.RoleId == r.RoleId) + .Where((ur, r) => ur.UserId == userId && r.RoleId > 0) + .Select((ur, r) => r) + .ToList(); } ///