diff --git a/SiNan.Business/AggregationBusiness.cs b/SiNan.Business/AggregationBusiness.cs index fc03980..f02f604 100644 --- a/SiNan.Business/AggregationBusiness.cs +++ b/SiNan.Business/AggregationBusiness.cs @@ -460,7 +460,7 @@ namespace SiNan.Business var IsAggregationDateEqualsYesterDay = (DateTime.Now.Date - aggregationDate).TotalDays == 1; var campaignList = fsql.Select().Where(c => c.ShopId == shopId && c.Date == aggregationDate) - .WhereIf(campaignId != null, c => c.CampaignId == campaignId) + .WhereIf(campaignId != null && campaignId != 0, c => c.CampaignId == campaignId) //.GroupBy(c => new { c.CampaignId, c.BusinessType }) .ToList(); @@ -625,9 +625,9 @@ namespace SiNan.Business var IsAggregationDateEqualsYesterDay = (DateTime.Now.Date - aggregationDate).TotalDays == 1; var adGroupList = fsql.Select().Where(c => c.ShopId == shopId && c.Date == aggregationDate) - .WhereIf(adGroupId != null, c => c.AdGroupId == adGroupId) - //.GroupBy(c => new { c.CampaignId, c.BusinessType }) - .ToList(); + .WhereIf(adGroupId != null && adGroupId != 0, c => c.AdGroupId == adGroupId) + //.GroupBy(c => new { c.CampaignId, c.BusinessType }) + .ToList(); var adGroupIdList = adGroupList.Select(j => j.AdGroupId).Distinct().ToArray(); if (adGroupIdList.Count() == 0) @@ -788,7 +788,7 @@ namespace SiNan.Business var IsAggregationDateEqualsYesterDay = (DateTime.Now.Date - aggregationDate).TotalDays == 1; var adSkuList = fsql.Select().Where(c => c.ShopId == shopId && c.Date == aggregationDate) - .WhereIf(skuId != null, c => c.Sku == skuId) + .WhereIf(!string.IsNullOrEmpty(skuId), c => c.Sku == skuId) //.GroupBy(c => new { c.Sku, c.BusinessType }) .ToList();