Commit 035cd550 authored by liudong1993's avatar liudong1993

1

parents 9d762aa0 e88ed253
......@@ -20,7 +20,7 @@ namespace Mall.Model.Extend.Assess
public List<AssessBrandImg> BrandImgList { get; set; }
/// <summary>
/// 所属分类名称
/// 分类名称
/// </summary>
public string CategoryName { get; set; }
}
......
......@@ -8,6 +8,7 @@
<ProjectReference Include="..\Mall.AOP\Mall.AOP.csproj" />
<ProjectReference Include="..\Mall.CacheManager\Mall.CacheManager.csproj" />
<ProjectReference Include="..\Mall.Model\Mall.Model.csproj" />
<ProjectReference Include="..\Mall.Module.User\Mall.Module.User.csproj" />
<ProjectReference Include="..\Mall.Repository\Mall.Repository.csproj" />
</ItemGroup>
......
......@@ -47,8 +47,11 @@ namespace Mall.Repository.Assess
parameters.Add("Name", "%" + dmodel.Name + "%");
}
string sql = $@"select * from RB_Assess_Brand e where {where} order by e.Id desc";
return GetPage<RB_Assess_Brand_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
string sql = $@"
select e.*,IFNULL(B.`Name`,'') AS CategoryName
from RB_Assess_Brand e LEFT JOIN rb_assess_category AS B ON e.CategoryId=B.Id
where {where} order by e.Id desc";
return GetPage<RB_Assess_Brand_Extend>(pageIndex, pageSize, out rowCount, sql, parameters).ToList();
}
/// <summary>
......
......@@ -80,16 +80,19 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetCategoryInfo() {
public ApiResult SetCategoryInfo()
{
var req = RequestParm;
RB_Assess_Category_Extend demodel = JsonHelper.DeserializeObject<RB_Assess_Category_Extend>(req.msg.ToString());
if (string.IsNullOrEmpty(demodel.Name)) {
if (string.IsNullOrEmpty(demodel.Name))
{
return ApiResult.ParamIsNull("请传递分类名称");
}
if (string.IsNullOrEmpty(demodel.Image)) {
if (string.IsNullOrEmpty(demodel.Image))
{
return ApiResult.ParamIsNull("请上传分类背景图片");
}
demodel.Enable = demodel.Enable == 0 ? 1:demodel.Enable;
demodel.Enable = demodel.Enable == 0 ? 1 : demodel.Enable;
demodel.TenantId = req.TenantId;
demodel.MallBaseId = req.MallBaseId;
......@@ -102,7 +105,8 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.Success();
}
else {
else
{
return ApiResult.Failed(msg);
}
}
......@@ -112,10 +116,12 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult DelCategoryInfo() {
public ApiResult DelCategoryInfo()
{
JObject parms = JObject.Parse(base.RequestParm.msg.ToString());
int CategoryId = parms.GetInt("CategoryId", 0);
if (CategoryId <= 0) {
if (CategoryId <= 0)
{
return ApiResult.ParamIsNull();
}
......@@ -132,11 +138,16 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetBrandPageList() {
public ApiResult GetBrandPageList()
{
var req = base.RequestParm;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(req.msg.ToString());
RB_Assess_Brand_Extend demodel = JsonConvert.DeserializeObject<RB_Assess_Brand_Extend>(req.msg.ToString());
JObject jobj = JObject.Parse(req.msg.ToString());
RB_Assess_Brand_Extend demodel = new RB_Assess_Brand_Extend()
{
CategoryId = jobj.GetInt("CategoryId"),
Name = jobj.GetStringValue("Name")
};
demodel.TenantId = req.TenantId;
demodel.MallBaseId = req.MallBaseId;
var list = assessModule.GetBrandPageList(pagelist.pageIndex, pagelist.pageSize, out long count, demodel);
......@@ -150,7 +161,9 @@ namespace Mall.WebApi.Controllers.MallBase
x.BrandImgList,
x.MoreDesc,
x.RemarkDesc,
CreateDate = x.CreateDate.ToString("yyyy-MM-dd HH:mm:ss")
CreateDate = x.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
x.CategoryName,
x.CategoryId,
});
return ApiResult.Success("", pagelist);
}
......@@ -190,7 +203,8 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetBrandInfo() {
public ApiResult SetBrandInfo()
{
var req = RequestParm;
RB_Assess_Brand_Extend demodel = JsonHelper.DeserializeObject<RB_Assess_Brand_Extend>(req.msg.ToString());
if (string.IsNullOrEmpty(demodel.Name))
......@@ -209,13 +223,19 @@ namespace Mall.WebApi.Controllers.MallBase
{
return ApiResult.ParamIsNull("请上传组图");
}
foreach (var item in demodel.BrandImgList) {
if (string.IsNullOrEmpty(item.Name)) {
int Sort = 1;
foreach (var item in demodel.BrandImgList)
{
item.Sort = Sort;
if (string.IsNullOrEmpty(item.Name))
{
return ApiResult.ParamIsNull("请上传组图标题");
}
if (string.IsNullOrEmpty(item.Path)) {
if (string.IsNullOrEmpty(item.Path))
{
return ApiResult.ParamIsNull("请传递组图路径");
}
Sort++;
}
demodel.BrandImg = JsonHelper.Serialize(demodel.BrandImgList);
if (string.IsNullOrEmpty(demodel.MoreDesc))
......@@ -304,15 +324,18 @@ namespace Mall.WebApi.Controllers.MallBase
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetGoodsReply() {
public ApiResult SetGoodsReply()
{
var req = base.RequestParm;
JObject parms = JObject.Parse(base.RequestParm.msg.ToString());
int GoodsId = parms.GetInt("GoodsId", 0);
string ReplyContent = parms.GetStringValue("ReplyContent");
if (GoodsId <= 0) {
if (GoodsId <= 0)
{
return ApiResult.ParamIsNull("请传递商品估价ID");
}
if (string.IsNullOrEmpty(ReplyContent)) {
if (string.IsNullOrEmpty(ReplyContent))
{
return ApiResult.ParamIsNull("请传递回复内容");
}
......
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