abc.GroupBy(c => c.activity_id).Select(c => new {
id = c.Key, //Key 就是上面的activity_id
count = c.Count(),
recharge_money = c.Sum(item => item.recharge_money),
presentd_money = c.Sum(item => item.presented_money)
}).Join(businessRecharge, n => n.id, b => b.Id, (n, b) => new
{
n.id,
n.count,
n.recharge_money,
n.presentd_money,
b.activity_name,
b.is_open,
activity_time = b.start_time.ToString() + " - " + b.end_time.ToString()
}).ToList();
网友评论