/// <summary> /// 获取用户组分页数据 /// </summary> /// <param name="appid">appid</param> /// <param name="page"></param> /// <param name="size"></param> /// <returns></returns> public ActionResult PageData(string appid, int page = 1, int size = 10) { var where = string.IsNullOrEmpty(appid) ? (Expression <Func <UserGroup, bool> >)(g => true) : (g => g.ClientApp.Any(a => a.AppId.Equals(appid))); List <int> ids = UserGroupBll.LoadPageEntitiesNoTracking <int, UserGroupOutputDto>(page, size, out int total, where, a => a.Id, false).Select(g => g.Id).ToList(); List <UserGroupOutputDto> list = new List <UserGroupOutputDto>(); ids.ForEach(g => { List <UserGroupOutputDto> temp = UserGroupBll.GetSelfAndChildrenByParentId(g).ToList(); list.AddRange(temp); }); return(PageResult(list.DistinctBy(u => u.Id), size, total)); }