Commit 1c5ff295 authored by liudong1993's avatar liudong1993

商品调整

parent a8cea655
......@@ -25,5 +25,9 @@ namespace Mall.Model.Extend.Product
/// 规格值列表
/// </summary>
public object AttrList { get; set; }
/// <summary>
/// 排序
/// </summary>
public int? Sort { get; set; }
}
}
......@@ -25,5 +25,9 @@ namespace Mall.Model.Extend.Product
/// 规格值列表
/// </summary>
public object AttrList { get; set; }
/// <summary>
/// 排序
/// </summary>
public int? Sort { get; set; }
}
}
......@@ -21,5 +21,9 @@ namespace Mall.Model.Extend.Product
/// 规格值列表
/// </summary>
public object AttrList { get; set; }
/// <summary>
/// 查询排序
/// </summary>
public int? SortNum { get; set; }
}
}
......@@ -2891,6 +2891,7 @@ namespace Mall.Module.Product
item.SpecificationValueList = svlist.Where(x => x.SpecificationId == item.Id).ToList();
}
}
int SortNum = 1;
model.SpecificationPriceList = goods_SpecificationPriceRepository.GetList(new RB_Goods_SpecificationPrice_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
foreach (var item in model.SpecificationPriceList)
{
......@@ -2914,7 +2915,10 @@ namespace Mall.Module.Product
}
item.AttrList = AttrList;
}
item.SortNum = SortNum;
SortNum++;
}
model.SpecificationPriceList = model.SpecificationPriceList.OrderByDescending(x => x.SortNum).ToList();
}
model.AreaList = new List<RB_Goods_Area_Extend>();
if (model.IsAreaBuy == 1)
......@@ -2929,6 +2933,7 @@ namespace Mall.Module.Product
if (model.DistributionCommissionList.Any())
{
int SortNum = 1;
//获取分销商启用等级
var dgradeList = distributor_GradeRepository.GetList(new RB_Distributor_Grade_Extend() { Enabled = 1, TenantId = TenantId, MallBaseId = MallBaseId });
dgradeList.Add(new RB_Distributor_Grade_Extend()
......@@ -2969,6 +2974,8 @@ namespace Mall.Module.Product
treemodel.AttrList = AttrList;
}
}
treemodel.Sort = SortNum;
treemodel.GradeCommissionList = treemodel.GradeCommissionList.OrderBy(x => x.DistributorGrade).ToList();
model.DistributionCommissionTreeList.Add(treemodel);
}
}
......@@ -2978,7 +2985,7 @@ namespace Mall.Module.Product
var treemodel = model.DistributionCommissionList.Where(x => (x.SpecificationSort ?? "") == qitem).FirstOrDefault();
treemodel.GradeCommissionList = new List<RB_Goods_DistributionCommission_Extend>();
var gradeCommList = model.DistributionCommissionList.Where(x => (x.SpecificationSort ?? "") == qitem).ToList();
dgradeList = dgradeList.OrderBy(x => x.Grade).ToList();
dgradeList = dgradeList.OrderByDescending(x => x.Grade).ToList();
foreach (var grade in dgradeList)
{
var gradeMList = gradeCommList.Where(x => x.DistributorGrade == grade.Id && x.SpecificationSort == qitem);
......@@ -3020,9 +3027,16 @@ namespace Mall.Module.Product
treemodel.AttrList = AttrList;
}
}
treemodel.Sort = SortNum;
treemodel.GradeCommissionList = treemodel.GradeCommissionList.OrderBy(x => x.DistributorGrade).ToList();
model.DistributionCommissionTreeList.Add(treemodel);
}
}
SortNum++;
if (model.DistributionCommissionTreeList.Any()) {
//倒序排一次
model.DistributionCommissionTreeList = model.DistributionCommissionTreeList.OrderByDescending(x => x.Sort).ToList();
}
}
}
model.MemberPriceList = new List<RB_Goods_MemberPrice_Extend>();
......@@ -3032,6 +3046,7 @@ namespace Mall.Module.Product
model.MemberPriceList = goods_MemberPriceRepository.GetList(new RB_Goods_MemberPrice_Extend() { GoodsId = goodsId, TenantId = TenantId, MallBaseId = MallBaseId });
if (model.MemberPriceList.Any())
{
int SortNum = 1;
var mgradeList = member_GradeRepository.GetList(new RB_Member_Grade_Extend() { Enabled = 1, TenantId = 1, MallBaseId = 1 });
string zdgradeStr = string.Join(",", mgradeList.Select(x => x.Id).OrderBy(x => x));
......@@ -3063,6 +3078,8 @@ namespace Mall.Module.Product
}
treemodel.AttrList = AttrList;
}
treemodel.Sort = SortNum;
treemodel.GradePriceList = treemodel.GradePriceList.OrderBy(x => x.MemberGrade).ToList();
model.MemberPriceTreeList.Add(treemodel);
}
}
......@@ -3073,7 +3090,7 @@ namespace Mall.Module.Product
var treemodel = model.MemberPriceList.Where(x => (x.SpecificationSort ?? "") == qitem).FirstOrDefault();
treemodel.GradePriceList = model.MemberPriceList.Where(x => (x.SpecificationSort ?? "") == qitem).ToList();
var gradePrice = model.MemberPriceList.Where(x => (x.SpecificationSort ?? "") == qitem).ToList();
mgradeList = mgradeList.OrderBy(x => x.Grade).ToList();
mgradeList = mgradeList.OrderByDescending(x => x.Grade).ToList();
foreach (var grade in mgradeList)
{
var gradeMList = gradePrice.Where(x => x.MemberGrade == grade.Id && x.SpecificationSort == qitem);
......@@ -3111,9 +3128,18 @@ namespace Mall.Module.Product
}
treemodel.AttrList = AttrList;
}
treemodel.Sort = SortNum;
treemodel.GradePriceList = treemodel.GradePriceList.OrderBy(x => x.MemberGrade).ToList();
model.MemberPriceTreeList.Add(treemodel);
}
}
SortNum++;
if (model.MemberPriceTreeList.Any())
{
//倒序排一次
model.MemberPriceTreeList = model.MemberPriceTreeList.OrderByDescending(x => x.Sort).ToList();
}
}
}
model.CarouselImageList = new List<RB_ImageCommonModel>();
......
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