Commit 98414202 authored by 黄奎's avatar 黄奎

页面修改

parent f483b225
......@@ -8468,46 +8468,52 @@ namespace Mall.Module.Product
}
/// <summary>
/// 批量操作
/// </summary>
/// <param name="commentIds"></param>
/// <param name="Id">评论Id</param>
/// <param name="orderDetailIds"></param>
/// <param name="type"></param>
/// <param name="content"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public bool SetCommentBatchByOrderDetailId(string orderDetailIds, int type, string content, int tenantId, int mallBaseId)
public bool SetCommentBatchByOrderDetailIdModule(int Id,string orderDetailIds, int type, string content, int tenantId, int mallBaseId)
{
bool flag = false;
//1批量回复 2批量隐藏 3批量显示 4批量置顶 5取消置顶 6批量删除
Dictionary<string, object> keyValues = new Dictionary<string, object>() { };
//回复
if (type == 1)
{ //回复
{
keyValues.Add(nameof(RB_Goods_Comment.Reply), content);
keyValues.Add(nameof(RB_Goods_Comment.UpdateDate), DateTime.Now);
}
//隐藏
else if (type == 2)
{ //影藏
{
keyValues.Add(nameof(RB_Goods_Comment.Is_Show), 2);
keyValues.Add(nameof(RB_Goods_Comment.UpdateDate), DateTime.Now);
}
//显示
else if (type == 3)
{
keyValues.Add(nameof(RB_Goods_Comment.Is_Show), 1);
keyValues.Add(nameof(RB_Goods_Comment.UpdateDate), DateTime.Now);
}
//置顶
else if (type == 4)
{
keyValues.Add(nameof(RB_Goods_Comment.Is_Top), 1);
keyValues.Add(nameof(RB_Goods_Comment.UpdateDate), DateTime.Now);
}
//取消置顶
else if (type == 5)
{
keyValues.Add(nameof(RB_Goods_Comment.Is_Top), 2);
keyValues.Add(nameof(RB_Goods_Comment.UpdateDate), DateTime.Now);
}
//批量删除
else if (type == 6)
{
keyValues.Add(nameof(RB_Goods_Comment.Status), 1);
......@@ -8518,24 +8524,35 @@ namespace Mall.Module.Product
return false;
}
List<WhereHelper> wheres = new List<WhereHelper>() {
new WhereHelper(){
FiledName=nameof(RB_Goods_Comment.OrderDetailId),
FiledValue=orderDetailIds,
OperatorEnum=OperatorEnum.IN
},
new WhereHelper(){
FiledName=nameof(RB_Goods_Comment.TenantId),
FiledValue=tenantId,
OperatorEnum=OperatorEnum.Equal
List<WhereHelper> wheres = new List<WhereHelper>()
{
new WhereHelper()
{
FiledName=nameof(RB_Goods_Comment.TenantId),
FiledValue=tenantId,
OperatorEnum=OperatorEnum.Equal
},
new WhereHelper(){
FiledName=nameof(RB_Goods_Comment.MallBaseId),
FiledValue=mallBaseId,
OperatorEnum=OperatorEnum.Equal
new WhereHelper()
{
FiledName=nameof(RB_Goods_Comment.MallBaseId),
FiledValue=mallBaseId,
OperatorEnum=OperatorEnum.Equal
}
};
return goods_CommentRepository.Update(keyValues, wheres);
if (Id > 0 || !string.IsNullOrEmpty(orderDetailIds))
{
if (Id > 0)
{
wheres.Add(new WhereHelper(nameof(RB_Goods_Comment.Id), Id));
}
if (!string.IsNullOrEmpty(orderDetailIds))
{
wheres.Add(new WhereHelper(nameof(RB_Goods_Comment.OrderDetailId), orderDetailIds, OperatorEnum.IN));
}
flag = goods_CommentRepository.Update(keyValues, wheres);
}
return flag;
}
/// <summary>
......
......@@ -4899,10 +4899,11 @@ namespace Mall.WebApi.Controllers.MallBase
{
var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString());
int Id = parms.GetInt("Id");
string orderDetailIds = parms.GetStringValue("OrderDetailIds");
int Type = parms.GetInt("Type", 1);//1批量回复 2批量隐藏 3批量显示 4批量置顶 5取消置顶 6批量删除
string Content = parms.GetStringValue("Content");
if (string.IsNullOrEmpty(orderDetailIds))
if (string.IsNullOrEmpty(orderDetailIds)&&Id<=0)
{
return ApiResult.ParamIsNull();
}
......@@ -4914,8 +4915,8 @@ namespace Mall.WebApi.Controllers.MallBase
}
}
bool flag = orderModule.SetCommentBatchByOrderDetailId(orderDetailIds, Type, Content, req.TenantId, req.MallBaseId);
if (flag) { return ApiResult.Success(); } else { return ApiResult.Failed(); }
bool flag = orderModule.SetCommentBatchByOrderDetailIdModule(Id,orderDetailIds, Type, Content, req.TenantId, req.MallBaseId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <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