|
|
|
@ -218,8 +218,8 @@ public class SysRoleService : ISysRoleService
|
|
|
|
|
IEnumerable<long?> delPermissions = existPermissions.AsQueryable().Except(model.PermissionIds);
|
|
|
|
|
if (delPermissions.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
db.Updateable<SysRolePermission>()
|
|
|
|
|
.SetColumns(it => it.IsPermission == 0)//SetColumns是可以叠加的 写2个就2个字段赋值
|
|
|
|
|
db.Deleteable<SysRolePermission>()
|
|
|
|
|
//.SetColumns(it => it.IsPermission == 0)//SetColumns是可以叠加的 写2个就2个字段赋值
|
|
|
|
|
.Where(it => it.RoleId == model.RoleId && delPermissions.Contains(it.PermissionId))
|
|
|
|
|
.ExecuteCommand();
|
|
|
|
|
}
|
|
|
|
@ -258,8 +258,8 @@ public class SysRoleService : ISysRoleService
|
|
|
|
|
IEnumerable<long?> delPermissions = existPermissions.AsQueryable().Except(model.PermissionIds);
|
|
|
|
|
if (delPermissions.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
db.Updateable<SysRolePermission>()
|
|
|
|
|
.SetColumns(it => it.IsPermission == 0)//SetColumns是可以叠加的 写2个就2个字段赋值
|
|
|
|
|
db.Deleteable<SysRolePermission>()
|
|
|
|
|
//.SetColumns(it => it.IsPermission == 0)//SetColumns是可以叠加的 写2个就2个字段赋值
|
|
|
|
|
.Where(it => it.RoleId == model.RoleId && delPermissions.Contains(it.PermissionId))
|
|
|
|
|
.ExecuteCommand();
|
|
|
|
|
}
|
|
|
|
|