Commit 37cd915d authored by liudong1993's avatar liudong1993

商品分类 显示/隐藏

parent 71fafe99
...@@ -452,6 +452,18 @@ namespace Mall.Module.Product ...@@ -452,6 +452,18 @@ namespace Mall.Module.Product
return list; return list;
} }
/// <summary>
/// 设置分类显示隐藏
/// </summary>
/// <param name="isShow"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public bool SetProductCategoryShow(int isShow, int tenantId, int mallBaseId)
{
return product_CategoryRepository.SetProductCategoryShow(isShow, tenantId, mallBaseId);
}
/// <summary> /// <summary>
/// 获取商品推荐列表 /// 获取商品推荐列表
/// </summary> /// </summary>
......
...@@ -107,5 +107,25 @@ namespace Mall.Repository.Product ...@@ -107,5 +107,25 @@ namespace Mall.Repository.Product
string sql = $@"select * from RB_Product_Category where {where} order by Id asc"; string sql = $@"select * from RB_Product_Category where {where} order by Id asc";
return Get<RB_Product_Category_Extend>(sql).ToList(); return Get<RB_Product_Category_Extend>(sql).ToList();
} }
/// <summary>
/// 设置分类显示/隐藏
/// </summary>
/// <param name="isShow"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public bool SetProductCategoryShow(int isShow, int tenantId, int mallBaseId)
{
string sql;
if (isShow == 1)
{
sql = $@"UPDATE rb_product_category SET IsShow =2 WHERE TenantId ={tenantId} and MallBaseId={mallBaseId} and `Status`=0 AND Enabled =1 AND IsShow =1;";
}
else {
sql = $@"UPDATE rb_product_category SET IsShow =1 WHERE TenantId ={tenantId} and MallBaseId={mallBaseId} and `Status`=0 AND Enabled =1 AND IsShow =2;";
}
return Execute(sql) > 0;
}
} }
} }
...@@ -657,6 +657,26 @@ namespace Mall.WebApi.Controllers.MallBase ...@@ -657,6 +657,26 @@ namespace Mall.WebApi.Controllers.MallBase
return flag ? ApiResult.Success() : ApiResult.Failed(); return flag ? ApiResult.Success() : ApiResult.Failed();
} }
/// <summary>
/// 分类显示 + 影藏
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult SetProductCategoryShow() {
var req = RequestParm;
JObject parms = JObject.Parse(req.msg.ToString());
int IsShow = parms.GetInt("IsShow", 2);//2 显示 1隐藏
bool flag = productModule.SetProductCategoryShow(IsShow, req.TenantId, req.MallBaseId);
if (flag)
{
return ApiResult.Success();
}
else {
return ApiResult.Failed();
}
}
#endregion #endregion
#region 商品规格 #region 商品规格
......
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