Commit 976a8c36 authored by 黄奎's avatar 黄奎

页面修改

parent bb3d7da0
......@@ -12,6 +12,9 @@ namespace Mall.Model.Extend.User
[DB(ConnectionName = "DefaultConnection")]
public class RB_MiniProgram_UserCenterMenu_Extend : Model.Entity.User.RB_MiniProgram_UserCenterMenu
{
/// <summary>
/// 用户中心菜单编号
/// </summary>
public string DetailIds { get; set; }
}
}
......@@ -449,7 +449,7 @@ namespace Mall.Module.User
}
if (isGetUserCenterMenu)
{
var menuList = centerMenuRepository.GetListExtRepository(new RB_MiniProgram_UserCenterMenu_Extend() { MallBaseId = extModel.MallBaseId });
var menuList = GetMiniProgramUserCenterMenuListModule(new RB_MiniProgram_UserCenterMenu_Extend() { MallBaseId = extModel.MallBaseId });
if (menuList != null && menuList.Count > 0)
{
extModel.FavoriteFootMenuList = menuList?.Where(qitem => qitem.MenuType == 1)?.ToList();
......@@ -472,6 +472,27 @@ namespace Mall.Module.User
return extModel;
}
/// <summary>
/// 根据查询条件获取小程序用户中心菜单列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_MiniProgram_UserCenterMenu_Extend> GetMiniProgramUserCenterMenuListModule(RB_MiniProgram_UserCenterMenu_Extend query)
{
return centerMenuRepository.GetMiniProgramUserCenterMenuListRepository(query);
}
/// <summary>
/// 删除小程序用户中心菜单
/// </summary>
/// <param name="DetailIds">详情编号</param>
/// <param name="MallBaseId">商城编号</param>
/// <returns></returns>
public bool DeleteMiniProgramUserCenterMenuModule(string DetailIds = "", int MallBaseId = 0)
{
return centerMenuRepository.DeleteMiniProgramUserCenterMenuRepository(DetailIds: DetailIds, MallBaseId: MallBaseId);
}
/// <summary>
/// 更新小程序状态
/// </summary>
......
......@@ -17,7 +17,7 @@ namespace Mall.Repository.User
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_MiniProgram_UserCenterMenu_Extend> GetListExtRepository(RB_MiniProgram_UserCenterMenu_Extend query)
public List<RB_MiniProgram_UserCenterMenu_Extend> GetMiniProgramUserCenterMenuListRepository(RB_MiniProgram_UserCenterMenu_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(" SELECT * FROM RB_MiniProgram_UserCenterMenu WHERE 1=1 ");
......@@ -27,8 +27,38 @@ namespace Mall.Repository.User
{
builder.AppendFormat(" AND MallBaseId={0} ", query.MallBaseId);
}
if (query.DetailIds != null && !string.IsNullOrWhiteSpace(query.DetailIds))
{
builder.AppendFormat(" AND DetailId IN({0}) ", query.DetailIds);
}
}
return Get<RB_MiniProgram_UserCenterMenu_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 删除小程序用户中心菜单
/// </summary>
/// <param name="DetailIds">详情编号</param>
/// <param name="MallBaseId">商城编号</param>
/// <returns></returns>
public bool DeleteMiniProgramUserCenterMenuRepository(string DetailIds = "", int MallBaseId = 0)
{
bool flag = true;
StringBuilder builder = new StringBuilder();
builder.AppendFormat("DELETE FROM RB_MiniProgram_UserCenterMenu WHERE 1=1 ");
if (!string.IsNullOrEmpty(DetailIds) || MallBaseId > 0)
{
if (!string.IsNullOrEmpty(DetailIds))
{
builder.AppendFormat(" AND DetailId IN({0}) ", DetailIds);
}
if (MallBaseId > 0)
{
builder.AppendFormat(" AND MallBaseId IN({0}) ", MallBaseId);
}
flag = base.Execute(builder.ToString()) > 0;
}
return flag;
}
}
}
......@@ -1168,8 +1168,19 @@ namespace Mall.WebApi.Controllers.User
public ApiResult RemoveMiniUserCenterMenu()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var DetailId = parms.GetInt("DetailId", 0);
var flag = programModule.RemoveMiniUserCenterMenuModule(DetailId);
var DetailId = parms.GetStringValue("DetailId");
var flag = programModule.DeleteMiniProgramUserCenterMenuModule(DetailIds:DetailId, MallBaseId:0);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
/// 根据商城Id删除用户中心菜单【恢复默认使用】
/// </summary>
/// <returns></returns>
public ApiResult RemoveMiniUserCenterMenuByMallId()
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var flag = programModule.DeleteMiniProgramUserCenterMenuModule(DetailIds:"",MallBaseId: RequestParm.MallBaseId);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
#endregion
......
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