var bookkeeperlist = await db.Bookkeeper.Where(a => a.AgentUserId == userId && a.ServiceItem == 1).GroupBy(b => b.BasicUserId).Select(a => new MyServicesListViewModel() { HeadIcon = apiUrl + a.FirstOrDefault(m => m.BasicUserId == a.Key).Basic_User.HeadIcon, UserName = a.FirstOrDefault(m => m.BasicUserId == a.Key).Basic_User.RealName, Mobile = a.FirstOrDefault(m => m.BasicUserId == a.Key).Basic_User.Mobile, DepartmentName = a.FirstOrDefault(m => m.BasicUserId == a.Key).Basic_User.Sys_Department.FullName, CompanyName = a.FirstOrDefault(m => m.BasicUserId == a.Key).Agent_Company.CompanyName, FlowName = a.FirstOrDefault(m => m.BasicUserId == a.Key).Agent_Bill.Agent_Flow.FlowName, ServiceItem = a.FirstOrDefault(m => m.BasicUserId == a.Key).ServiceItem }).ToListAsync(); return bookkeeperlist;