Commit d22cba26 authored by liudong1993's avatar liudong1993
parents d1876e8a 94b2c445
using Mall.Common.AOP;
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Extend.Statistics
{
/// <summary>
/// 首页统计
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class MallIndexStatistics
{
}
}
......@@ -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; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Mall.Model.Query
{
/// <summary>
/// 统计查询条件
/// </summary>
public class StatisticsQuery
{
}
}
......@@ -884,6 +884,17 @@ namespace Mall.Module.Product
{
return null;
}
else
{
model.CoverImage = "";
if (!string.IsNullOrEmpty(model.CarouselImage) && model.CarouselImage != "[]")
{
List<string> CarouselIdList = JsonConvert.DeserializeObject<List<string>>(model.CarouselImage);
//封面图
model.CoverImage = CarouselIdList[0];
//轮播图
}
}
//小程序名称
model.MallName = programRepository.GetEntity(model.MallBaseId)?.MallName ?? "";
......
......@@ -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>
......
using System;
using System.Collections.Generic;
using System.Text;
using Mall.Model.Entity.User;
using Mall.Model.Extend.User;
using System.Linq;
using Mall.Model.Extend.Statistics;
using Mall.Model.Query;
namespace Mall.Repository.User
{
/// <summary>
/// 商城统计
/// </summary>
public class MallStatisticsRepository : RepositoryBase<MallIndexStatistics>
{
/// <summary>
/// 用户统计
/// </summary>
public void MemberUserStatistics(StatisticsQuery query)
{
}
/// <summary>
/// 订单统计
/// </summary>
public void OrderStatistics(StatisticsQuery query)
{
}
}
}
......@@ -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