diff --git a/SBF.Business/TrusteeshipBusiness.cs b/SBF.Business/TrusteeshipBusiness.cs index 7b25dae..58379da 100644 --- a/SBF.Business/TrusteeshipBusiness.cs +++ b/SBF.Business/TrusteeshipBusiness.cs @@ -98,6 +98,8 @@ namespace SBF.Business .WhereIf(request.Stage != null, (t, p, ps) => p.Stage == request.Stage) .WhereIf(!string.IsNullOrEmpty(request.Spu), (t, p, ps) => t.SpuId == request.Spu) .WhereIf(!string.IsNullOrEmpty(request.Sku), (t, p, ps) => t.SkuId == request.Sku) + .WhereIf(request.IsEnd == 1, (t, p, ps) => t.IsEnd == true) + .WhereIf(request.IsEnd == 0, (t, p, ps) => t.IsEnd == false) .WhereIf(!string.IsNullOrEmpty(request.Title), (t, p, ps) => p.Title.StartsWith(request.Title)) .OrderByDescending((t, p, ps) => t.CreateTime) .Page(request.PageIndex, request.PageSize) @@ -146,7 +148,7 @@ namespace SBF.Business var endDate = DateTime.Now.Date.AddDays(-1); var skuIdList = list.Select(x => x.SkuId).Distinct().ToList(); - var spuIdList = list.Select(x => x.SpuId).Distinct().ToList(); + //var spuIdList = list.Select(x => x.SpuId).Distinct().ToList(); #region 推广花费 @@ -165,14 +167,14 @@ namespace SBF.Business #endregion #region 商品营业额 - var actualAmountList = fsql.Select() + var actualAmountList = fsql.Select() .Where(x => x.ShopId == request.ShopId && x.Date >= startDate && x.Date <= endDate && - spuIdList.Contains(x.ProductId)) + skuIdList.Contains(x.SkuId)) .ToList(x => new { x.Date, - x.ProductId, + x.SkuId, x.Cost, x.ActualAmount }); @@ -200,7 +202,7 @@ namespace SBF.Business Value = x.Cost }).ToList(); - task.ActualAmountByDateList = actualAmountList.Where(x => x.ProductId == task.SpuId) + task.ActualAmountByDateList = actualAmountList.Where(x => x.SkuId == task.SkuId) .OrderBy(x => x.Date) .Select(x => new NumberByDate() { diff --git a/SBF.Model/Db/Aggregation/AggregationJDPopularizeSkuDaily.cs b/SBF.Model/Db/Aggregation/AggregationJDPopularizeSkuDaily.cs index f463a69..92c4117 100644 --- a/SBF.Model/Db/Aggregation/AggregationJDPopularizeSkuDaily.cs +++ b/SBF.Model/Db/Aggregation/AggregationJDPopularizeSkuDaily.cs @@ -61,6 +61,11 @@ namespace SBF.Model.Db [Column(StringLength = 50)] public string SkuId { get; set; } + /// + /// 商品营业额(SKU实收) + /// + [Column(DbType = "decimal(18,2)")] + public decimal? ActualAmount { get; set; } = 0.00M; } } diff --git a/SBF.Model/Dto/Request/QueryTrusteeshipRequest.cs b/SBF.Model/Dto/Request/QueryTrusteeshipRequest.cs index e2b2b4f..f92352c 100644 --- a/SBF.Model/Dto/Request/QueryTrusteeshipRequest.cs +++ b/SBF.Model/Dto/Request/QueryTrusteeshipRequest.cs @@ -9,6 +9,11 @@ /// public int BusinessType { get; set; } + /// + /// 是否结束 1结束 0未结束 null两者都包含 + /// + public int? IsEnd { get; set; } + public long? ShopId { get; set; } public string Spu { get; set; }