Commit 897a57a0 authored by 黄奎's avatar 黄奎

新增实体类

parent ae437b7b
......@@ -5383,6 +5383,37 @@ namespace Mall.Module.Product
return treeList;
}
/// <summary>
/// 获取树形结构列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public List<RB_Product_Category_Extend> GetProductCategoryAllList(RB_Product_Category_Extend demodel)
{
var list = product_CategoryRepository.GetList(demodel);
if (list.Any())
{
List<int> ImgIds = new List<int>();
ImgIds.AddRange(list.Select(x => x.Icon ?? 0).Distinct());
ImgIds.AddRange(list.Select(x => x.BigIcon ?? 0).Distinct());
ImgIds.AddRange(list.Select(x => x.AdvertisingImage ?? 0).Distinct());
List<RB_Material_Info_Extend> mlist = new List<RB_Material_Info_Extend>();
if (ImgIds.Any())
{
mlist = material_InfoRepository.GetList(new RB_Material_Info_Extend() { MaterialIds = string.Join(",", ImgIds), TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
}
foreach (var item in list)
{
item.IconPath = mlist.Where(x => x.Id == item.Icon).FirstOrDefault()?.Path ?? "";
item.BigIconPath = mlist.Where(x => x.Id == item.BigIcon).FirstOrDefault()?.Path ?? "";
item.AdvertisingImagePath = mlist.Where(x => x.Id == item.AdvertisingImage).FirstOrDefault()?.Path ?? "";
item.CategoryPageTypeStr = item.CategoryPageType.GetEnumName();
}
list = list.OrderBy(x => x.Sort).ThenBy(x => x.Id).ToList();
}
return list;
}
/// <summary>
/// 获取子集列表
/// </summary>
......
......@@ -53,7 +53,7 @@ WHERE 1=1
parameters.Add("Name", "%" + query.Title.Trim() + "%");
}
}
return GetPage<RB_Commerce_Activity_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
return GetPage<RB_Commerce_News_Extend>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
}
}
......@@ -94,6 +94,28 @@ namespace Mall.WebApi.Controllers.MallBase
return ApiResult.Success("", list);
}
/// <summary>
/// 获取分类树形结构
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetProductCategoryAllList(object requestMsg)
{
var parms = JsonConvert.DeserializeObject<RequestParm>(requestMsg.ToString());
if (parms.MallBaseId <= 0)
{
return ApiResult.ParamIsNull();
}
RB_Product_Category_Extend demodel = JsonConvert.DeserializeObject<RB_Product_Category_Extend>(parms.msg.ToString());
demodel.TenantId = parms.TenantId;
demodel.MallBaseId = parms.MallBaseId;
demodel.Enabled = 1;
demodel.IsShow = 1;
var list = productModule.GetProductCategoryAllList(demodel);
return ApiResult.Success("", list);
}
/// <summary>
/// 获取分类样式
/// </summary>
......
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