Commit 98ba09cc authored by liudong1993's avatar liudong1993

1

parent 4f651e18
...@@ -90,7 +90,7 @@ namespace Mall.Module.Miai ...@@ -90,7 +90,7 @@ namespace Mall.Module.Miai
bool flag = assess_CategoryRepository.Insert(demodel) > 0; bool flag = assess_CategoryRepository.Insert(demodel) > 0;
return flag ? "" : "出错了,请联系管理员"; return flag ? "" : "出错了,请联系管理员";
} }
} }
/// <summary> /// <summary>
/// 删除分类 /// 删除分类
...@@ -165,6 +165,86 @@ namespace Mall.Module.Miai ...@@ -165,6 +165,86 @@ namespace Mall.Module.Miai
return list; return list;
} }
/// <summary>
/// 获取品牌分组列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public object GetBrandGroupList(RB_Assess_Brand_Extend demodel)
{
List<object> RList = new List<object>();
var list = assess_BrandRepository.GetList(demodel);
if (list.Any())
{
foreach (var item in list)
{
item.BrandImgList = new List<AssessBrandImg>();
if (!string.IsNullOrEmpty(item.BrandImg))
{
item.BrandImgList = JsonHelper.DeserializeObject<List<AssessBrandImg>>(item.BrandImg);
item.BrandImgList = item.BrandImgList.Where(x => !string.IsNullOrEmpty(x.Name)).ToList();
}
}
RList.Add(
new
{
letter = "*",
data = list.Where(x => x.IsHot == 1).Take(9).Select(x => new
{
x.Id,
x.Name,
x.PinYin,
x.Logo,
x.IsHot,
x.BrandImgList,
x.MoreDesc,
x.RemarkDesc
})
});
list.Where(x => !string.IsNullOrEmpty(x.PinYin)).GroupBy(x => x.PinYin).OrderBy(x => x.Key).ToList().ForEach(item =>
{
RList.Add(new
{
letter = item.Key,
data = item.Select(x => new
{
x.Id,
x.Name,
x.PinYin,
x.Logo,
x.IsHot,
x.BrandImgList,
x.MoreDesc,
x.RemarkDesc
})
});
});
if (list.Where(x => string.IsNullOrEmpty(x.PinYin)).Any())
{
RList.Add(new
{
letter = "#",
data = list.Where(x => string.IsNullOrEmpty(x.PinYin)).Select(x => new
{
x.Id,
x.Name,
x.PinYin,
x.Logo,
x.IsHot,
x.BrandImgList,
x.MoreDesc,
x.RemarkDesc
})
});
}
}
return RList;
}
/// <summary> /// <summary>
/// 获取详情 /// 获取详情
/// </summary> /// </summary>
......
...@@ -80,6 +80,21 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -80,6 +80,21 @@ namespace Mall.WebApi.Controllers.MallBase
})); }));
} }
/// <summary>
/// 获取品牌分组列表
/// </summary>
/// <returns></returns>
[HttpPost]
[RateValve(Policy = Policy.Ip, Limit = 30, Duration = 60)]
public ApiResult GetBrandGroupList() {
var req = base.RequestParm;
RB_Assess_Brand_Extend demodel = JsonConvert.DeserializeObject<RB_Assess_Brand_Extend>(req.msg.ToString());
demodel.MallBaseId = req.MallBaseId;
var list = assessModule.GetBrandGroupList(demodel);
return ApiResult.Success("", list);
}
/// <summary> /// <summary>
/// 获取品牌详情 /// 获取品牌详情
/// </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