var list = from a in oSC_CaiGou
join b in oSC_Contractlist
on a.ContractGuid equals b.Guid
join c in oSC_XiangMulist
on b.XiangMuGuid equals c.Guid
join d in oL_UserBaselist
on b.YGUserGuid equals d.Guid
join e in oSC_UserTablelist
on c.UserTableGuid equals e.Guid
join f in oSC_CaiWulist
on a.ContractGuid equals f.ContractGuid
group new { a, b, c, d, e, f } by new { fContractGuid = f.ContractGuid, b.ID, ContractGuid = a.ContractGuid, c.Guid, b.BianHao, UserTablename = e.Name, XiangMuName = c.Name, HTCountInt = b.CountInt, YGUserGuidName = d.Name, b.Images } into gr
select new
{
ContractGuid = gr.Key.ContractGuid,
BianHao = gr.Key.BianHao,
XiangMuName = gr.Key.XiangMuName,
//XiangMuGuid = gr.Key.XiangMuGuid,
CountInt = gr.Sum(u => u.a.CountInt),
ProPrice = gr.Sum(u => u.a.ProPrice),
UserTablename = gr.Key.UserTablename,
HTCountInt = gr.Key.HTCountInt,
YGUserGuidName = gr.Key.YGUserGuidName,
Images = gr.Key.Images,
ID = gr.Key.ID,
};