var result = DataSummaryRepository.FindBy(x => x.UserID == argMemberNo && x.SummaryDate <= argEndDate && x.SummaryDate >= argStarDate).OrderByDescending(x => x.SummaryDate).GroupBy(x => new { x.SummaryDate, x.UserID }).Select(g => new { PV = g.Sum(x => x.PV), UV = g.Sum(x => x.UV), OrderQunantity = g.Sum(x => x.OrderQunantity), OrderAmount = g.Sum(x => x.OrderAmount), CommissionEstimate = g.Sum(x => x.CommissionEstimate), AvaliableCommission = g.Sum(x => x.AvaliableCommission), HistoryCommission = g.Sum(x => x.HistoryCommission), SummaryDate = g.Key.SummaryDate, UserID = g.Key.UserID });
Entity Framework Lambda 实现多列Group by,并汇总求和,布布扣,bubuko.com
时间: 2024-10-10 06:44:37