Commit edf5ca65 authored by 吴春's avatar 吴春
parents 68cc1d07 cabad9cb
......@@ -1278,6 +1278,7 @@ namespace Mall.Module.Product
}
#endregion
List<RB_Goods_CouponModel> GoodsCouponList = new List<RB_Goods_CouponModel>();//商品优惠卷 价格(每个商品优惠的价格)
List<int> YFCategoryList = new List<int>();//全局适配 分类
//初始化值
foreach (var item in demodel.DetailList)
{
......@@ -1288,6 +1289,9 @@ namespace Mall.Module.Product
}
int GoodsWeight = gmodel.GoodsWeight ?? 0;//商品重量
var categoryList = clist.Where(x => x.GoodsId == item.GoodsId).ToList();
if ((mallbaseModel?.IsFreeShipping ?? 0) == 1 && (gmodel.FullMoneyPinkage ?? 0) == 0 && (gmodel.FullNumPinkage ?? 0) == 0) {
YFCategoryList.AddRange(categoryList.Select(x => x.CategoryId ?? 0).ToList());
}
#region 图片
gmodel.CoverImage = "";
......@@ -1631,6 +1635,13 @@ namespace Mall.Module.Product
}
}
}
#region 处理全局包邮
List<RB_FreeShipping_Extend> freeShippingList = new List<RB_FreeShipping_Extend>();
if (YFCategoryList.Any()) {
string categoryIds = string.Join(",", YFCategoryList.Distinct());
freeShippingList = freeShippingRepository.GetFreeShippingListByCategoryIds(new RB_FreeShipping_Extend { MallBaseId = demodel.MallBaseId, TenantId = demodel.TenantId, CategoryIds = categoryIds });
}
#endregion
//赋值
foreach (var item in demodel.DetailList)
{
......@@ -1755,10 +1766,31 @@ namespace Mall.Module.Product
}
}
}
else {
if ((gmodel.FullMoneyPinkage ?? 0) == 0 && (gmodel.FullNumPinkage ?? 0) == 0 && YFCategoryList.Any()) {
//查找全局包邮规则
//if (freeShippingList != null && freeShippingList.Any())
//{
// var nowcategory = categoryList.Where(x => x.GoodsId == item.GoodsId).Select(x => x.CategoryId);
// var fullNumPinkageModel = freeShippingList.Where(x => nowcategory.Contains(x.CategoryId) && x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullNumPinkage > 0).OrderBy(x => x.FullNumPinkage).FirstOrDefault();
// if (fullNumPinkageModel == null || fullNumPinkageModel.ID <= 0)
// {
// fullNumPinkageModel = freeShippingList.Where(x => x.IsFreeShipping == 1 && x.IsEnable == 1 && x.FullMoneyPinkage > 0).OrderBy(x => x.FullMoneyPinkage).FirstOrDefault();
// }
// item.FreeShippingModel = (fullNumPinkageModel == null || fullNumPinkageModel.ID <= 0) ? new RB_FreeShipping_Extend() : fullNumPinkageModel;
//}
//else
//{
// item.FreeShippingModel = new RB_FreeShipping_Extend();
//}
}
}
}
TotalExpress += Express;
item.Final_Price += Express;
item.Express = Express;
TotalGoodsMoney += Express;
#endregion
var areaGoods = AreaList.Where(x => x.GoodsId == item.GoodsId).ToList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment