Commit dd751dcf authored by 黄奎's avatar 黄奎

页面修改

parent 321b7962
......@@ -17,5 +17,15 @@ namespace Mall.Model.Extend.Product
/// 商品编号
/// </summary>
public string GoodIds { get; set; }
/// <summary>
/// 等级价格列表
/// </summary>
public List<RB_Groupbuy_Memberprice_Extend> GradeMemberPriceList { get; set; }
/// <summary>
/// 规格值列表
/// </summary>
public object AttrList { get; set; }
}
}
\ No newline at end of file
......@@ -253,6 +253,13 @@ namespace Mall.Module.Product
TenantId = query.TenantId,
GoodsId = extModel.GoodId,
});
//会员价设置列表
List<RB_Groupbuy_Memberprice_Extend> memberpriceList = GetGroupBuyMemberpriceModule(new RB_Groupbuy_Memberprice_Extend()
{
MallBaseId = query.MallBaseId,
TenantId = query.TenantId,
GoodsId = extModel.GoodId,
});
if (groupStepList != null && groupStepList.Count > 0)
{
......@@ -298,6 +305,28 @@ namespace Mall.Module.Product
}
}
}
//会员价设置
item.MemberpriceList = new List<RB_Groupbuy_Memberprice_Extend>();
var gradeMemberList = memberpriceList.Where(qitem => qitem.StepId == item.StepId).GroupBy(qitem => new { qitem.SpecificationSort, qitem.StepId }).ToList();
foreach (var subItem in gradeMemberList)
{
var tempModel = memberpriceList.Where(qitem => qitem.StepId == subItem.Key.StepId && qitem.SpecificationSort == subItem.Key.SpecificationSort).FirstOrDefault();
item.MemberpriceList.Add(new RB_Groupbuy_Memberprice_Extend()
{
SpecificationSort = tempModel.SpecificationSort,
GradeMemberPriceList =
memberpriceList.Where(qitem => qitem.StepId == subItem.Key.StepId && qitem.SpecificationSort == subItem.Key.SpecificationSort)
.OrderBy(qitem => qitem.MemberGrade).ToList()
});
}
foreach (var subItem in item.MemberpriceList)
{
if (!string.IsNullOrWhiteSpace(subItem.SpecificationSort))
{
subItem.AttrList = GetGroupBuyGoodsAttr(subItem.SpecificationSort, specificationList);
}
}
}
}
extModel.SpecificationList = specificationList;
......@@ -595,17 +624,32 @@ namespace Mall.Module.Product
{
foreach (var subItem in groupItem.MemberpriceList)
{
subItem.StepId = groupItem.StepId;
if (subItem.Id > 0)
{
flag = groupbuy_MemberpriceRepository.Update(subItem);
}
else
if (subItem.GradeMemberPriceList != null && subItem.GradeMemberPriceList.Count>0)
{
var newMemberId = groupbuy_MemberpriceRepository.Insert(subItem);
subItem.Id = newMemberId;
flag = newMemberId > 0;
foreach (var childItem in subItem.GradeMemberPriceList)
{
childItem.SpecificationSort = subItem.SpecificationSort;
childItem.GoodsId = extModel.GoodId;
childItem.Status = 0;
childItem.TenantId = extModel.TenantId;
childItem.MallBaseId = extModel.MallBaseId;
childItem.StepId = groupItem.StepId;
if (childItem.Id > 0)
{
childItem.UpdateDate = DateTime.Now;
flag = groupbuy_MemberpriceRepository.Update(childItem);
}
else
{
childItem.CreateDate = DateTime.Now;
childItem.UpdateDate = DateTime.Now;
var newMemberId = groupbuy_MemberpriceRepository.Insert(childItem);
childItem.Id = newMemberId;
flag = newMemberId > 0;
}
}
}
}
}
}
......
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