|
|
@ -78,7 +78,33 @@ namespace Coldairarrow.Business.HuiYan |
|
|
|
|
|
|
|
public AjaxResult GetTaskCount() |
|
|
|
{ |
|
|
|
var list = Db.GetIQueryable<pricetasklog>().Where(c => c.UserId == _operator.UserId).Select(c => c.State).ToList(); |
|
|
|
Expression<Func<teamitems, items, pricetasklog, TeamitemDto>> select = (a, b, c) => new TeamitemDto |
|
|
|
{ |
|
|
|
GoodsId = b.GoodsId, |
|
|
|
HasFilter = b.HasFilter, |
|
|
|
Platform = b.Platform, |
|
|
|
GoodsUrl = b.GoodsUrl, |
|
|
|
PriceTaskId = c.Id, |
|
|
|
PriceTaskState = (int)c.State, |
|
|
|
Extensions = Newtonsoft.Json.JsonConvert.DeserializeObject<List<TeamItemExtension>>(a.ExtensionJson) |
|
|
|
}; |
|
|
|
|
|
|
|
select = select.BuildExtendSelectExpre(); |
|
|
|
|
|
|
|
var q_titem = Db.GetIQueryable<teamitems>(); |
|
|
|
var q = from a in q_titem.AsExpandable() |
|
|
|
join b in Db.GetIQueryable<items>() on a.ItemId equals b.Id into ab |
|
|
|
from ba in ab.DefaultIfEmpty() |
|
|
|
join c in Db.GetIQueryable<pricetasklog>() on a.Id equals c.TeamItemId into ac |
|
|
|
from bb in ac.DefaultIfEmpty() |
|
|
|
select @select.Invoke(a, ba, bb); |
|
|
|
|
|
|
|
//查询对应状态
|
|
|
|
var where = LinqHelper.True<TeamitemDto>().And(c => c.PriceTaskUserId == _operator.UserId); |
|
|
|
|
|
|
|
where = where.And(c => c.PriceTaskState != null); |
|
|
|
|
|
|
|
var list = q.Where(where).Select(c => c.PriceTaskState).ToList(); |
|
|
|
|
|
|
|
return Success(list.GroupBy(c => c).Select(c => new { Id = c.Key, Count = c.Count() })); |
|
|
|
} |
|
|
|