Browse Source

mainskuid

GOIAggregation
sanji 2 years ago
parent
commit
7946c8e3b0
  1. 10
      SiNan.Business/GOIBusiness.cs

10
SiNan.Business/GOIBusiness.cs

@ -380,7 +380,8 @@ namespace SiNan.Business
Recent30dProductLevelProfit = ap.Recent30dProductLevelProfit,
Date = ap.Date,
UpdateTime = ap.UpdateTime,
MaxDeficitThreshold = p.MaxDeficitThreshold
MaxDeficitThreshold = p.MaxDeficitThreshold,
MainSkuId = p.MainSkuId
}).Map<List<ProductGOIResponse>>();
var productIdList = productList.Select(p => p.Id).ToList();
@ -392,7 +393,12 @@ namespace SiNan.Business
foreach (var product in productList)
{
var currentProductSkuIdList = skuList.Where(s => s.ProductId == product.Id).Select(s => s.Id).ToList();
var firstSku = skuList.FirstOrDefault(s => currentProductSkuIdList.Contains(s.Id));
ProductSku firstSku = null;
if (!string.IsNullOrEmpty(product.MainSkuId))
firstSku = skuList.FirstOrDefault(s => s.Id == product.MainSkuId);
if (firstSku == null)
firstSku = skuList.FirstOrDefault(s => currentProductSkuIdList.Contains(s.Id));
product.Logo = firstSku?.Logo;
product.MainSkuId = firstSku?.Id;
var currentProductHistoryPopularizeLevelGOIList = historyPopularizeLevelGOIList.Where(x => currentProductSkuIdList.Contains(x.Sku));

Loading…
Cancel
Save