Commit 035cd550 authored by liudong1993's avatar liudong1993

1

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