8,497
社区成员
发帖
与我相关
我的任务
分享
public int? CityId { get; set; }
public virtual City City { get; set; }
var query = from a in dbContext.Customers.Include("Cooperations").Include("Staff").Include("City")
join b in dbContext.Business
on new { Cus = a.ID, Stf = a.StaffID } equals new { Cus = b.CustomerID == null ? 0 : b.CustomerID.Value, Stf = b.StaffID } into t
join c in dbContext.Provinces on (a.CityId == null ? 0 : a.City.ProvinceID) equals c.ID into x
where staffids.Contains(a.StaffID == null ? -1 : a.StaffID.Value)
select new BusinessVM
{
Customer = a,
Business = t.Where(p => (p.CreateTime > parm.startdate.Value && p.CreateTime < parm.enddate.Value)),
Provienc = "江南"
};
return query.OrderByDescending(u => u.Customer.ID).Skip(itemIndex).Take(pageSize).ToList();