public IActionResult GetExcludeUsers(string roleId) { if (string.IsNullOrEmpty(roleId)) { return(ToResponse(StatusCodeType.Error, "roleId 不能为空")); } // 取得该角色所有添加的用户 var userIds = _userRoleService.GetWhere(m => m.RoleID == roleId).Select(m => m.UserID); // 获取未添加用户 var response = _userService.GetWhere(m => !userIds.Contains(m.UserID)).OrderBy(m => m.CreateTime); return(ToResponse(response)); }
public IActionResult QueryList(string QueryText = null) { //开始拼装查询条件 if (string.IsNullOrEmpty(QueryText)) { var response = _usersService.GetAll(); return(toResponse(response)); } else { var response = _usersService.GetWhere(m => m.UserID.Contains(QueryText) || m.UserName.Contains(QueryText)); return(toResponse(response)); } }