Commit 9c2270e2 authored by liudong1993's avatar liudong1993

分销最高返佣

parent f88c9060
......@@ -1346,14 +1346,14 @@ namespace Mall.Module.Product
if (disModel.GradeId == 0)
{
//拿分销基础配置
if ((BasicsModel?.IsCommissionResidue ?? 2) == 1)
{
model.MaxShare = (BasicsModel?.OneCommission ?? 0) + (BasicsModel?.TwoCommission ?? 0) + (BasicsModel?.ThreeCommission ?? 0);
}
else
{
//if ((BasicsModel?.IsCommissionResidue ?? 2) == 1)
//{
// model.MaxShare = (BasicsModel?.OneCommission ?? 0) + (BasicsModel?.TwoCommission ?? 0) + (BasicsModel?.ThreeCommission ?? 0);
//}
//else
//{
model.MaxShare = BasicsModel?.OneCommission ?? 0;
}
//}
if ((BasicsModel?.DistributorCommissionType ?? 2) == 1)
{
model.MaxShare = Math.Round(model.MaxShare * MaxSellMoney / 100, 2, MidpointRounding.AwayFromZero);
......@@ -1365,14 +1365,14 @@ namespace Mall.Module.Product
var disgradeModel = distributor_GradeRepository.GetEntity(disModel.GradeId);
if (disgradeModel != null)
{
if ((BasicsModel?.IsCommissionResidue ?? 2) == 1)
{
model.MaxShare = (disgradeModel?.OneCommission ?? 0) + (disgradeModel?.TwoCommission ?? 0) + (disgradeModel?.ThreeCommission ?? 0);
}
else
{
//if ((BasicsModel?.IsCommissionResidue ?? 2) == 1)
//{
// model.MaxShare = (disgradeModel?.OneCommission ?? 0) + (disgradeModel?.TwoCommission ?? 0) + (disgradeModel?.ThreeCommission ?? 0);
//}
//else
//{
model.MaxShare = disgradeModel?.OneCommission ?? 0;
}
//}
if ((disgradeModel?.DistributionCommissionType ?? 2) == 1)
{
model.MaxShare = Math.Round(model.MaxShare * MaxSellMoney / 100, 2, MidpointRounding.AwayFromZero);
......@@ -3218,8 +3218,25 @@ namespace Mall.Module.Product
if (!string.IsNullOrEmpty(demodel.CategoryIds) && !demodel.CategoryIds.Contains(','))
{
//获取该分类下所有子集分类
var cmodel = goods_CategoryRepository.GetEntity(demodel.CategoryIds);
//goods_CategoryRepository.GetList(new RB_Goods_Category_Extend() { TenantId });
var cmodel = product_CategoryRepository.GetEntity(demodel.CategoryIds);
if (cmodel != null)
{
List<int> AllClist = new List<int>();
AllClist.Add(cmodel.Id);
var clist = product_CategoryRepository.GetList(new RB_Product_Category_Extend() { TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId, RootId = cmodel.RootId });
var OneList = clist.Where(x => x.ParentId == cmodel.Id).ToList();
foreach (var item in OneList)
{
AllClist.Add(item.Id);
var TwoList = clist.Where(x => x.ParentId == item.Id).ToList();
if (TwoList.Any()) {
AllClist.AddRange(TwoList.Select(x => x.Id).Distinct().ToList());
}
}
if (AllClist.Any()) {
demodel.CategoryIds = string.Join(",", AllClist);
}
}
}
var list = goodsRepository.GetPageList(pageIndex, pageSize, out count, demodel);
if (list.Any())
......
......@@ -195,7 +195,7 @@ namespace Mall.WebApi.Controllers
else
{
childItem.goodsList = new List<GoodsDetailsItem2>();
var catGoodsList = productModule.GetProductGoodsPageList(1, childItem.goodsNum, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
var catGoodsList = productModule.GetProductGoodsPageList_V2(1, childItem.goodsNum, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
{
TenantId = TenantId,
MallBaseId = MallBaseId,
......@@ -227,7 +227,7 @@ namespace Mall.WebApi.Controllers
if (goodsData.addGoodsType == 0)
{
goodsData.list = new List<GoodsDetailsItem2>();
var goodsList = productModule.GetProductGoodsPageList(1, goodsData.goodsLength, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
var goodsList = productModule.GetProductGoodsPageList_V2(1, goodsData.goodsLength, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
{
TenantId = TenantId,
MallBaseId = MallBaseId,
......@@ -742,7 +742,7 @@ namespace Mall.WebApi.Controllers
};
if (subitem.relation_id == 0)
{
var goodsList = productModule.GetProductGoodsPageList(1, 6, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
var goodsList = productModule.GetProductGoodsPageList_V2(1, 6, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
{
TenantId = Convert.ToInt32(miniProgram.TenantId),
MallBaseId = miniProgram.MallBaseId,
......@@ -765,7 +765,7 @@ namespace Mall.WebApi.Controllers
}
else
{
var goodsList = productModule.GetProductGoodsPageList(1, 6, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
var goodsList = productModule.GetProductGoodsPageList_V2(1, 6, out long rowsCount, new Model.Extend.Product.RB_Goods_Extend()
{
TenantId = Convert.ToInt32(miniProgram.TenantId),
MallBaseId = miniProgram.MallBaseId,
......
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