Commit 9869329d authored by 黄奎's avatar 黄奎

页面修改

parent 8a8f9298
......@@ -101,5 +101,10 @@ namespace Mall.Model.Entity.User
get;
set;
}
/// <summary>
/// 排序
/// </summary>
public int TagSort { get; set; }
}
}
......@@ -12,6 +12,9 @@ namespace Mall.Model.Extend.User
[DB(ConnectionName = "DefaultConnection")]
public class RB_Miniprogram_Bottomnav_Extend:Model.Entity.User.RB_Miniprogram_Bottomnav
{
/// <summary>
/// 标签是否激活状态【前端使用】
/// </summary>
public bool IsActive { get; set; }
}
}
......@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text;
using Mall.Model.Extend.User;
using Mall.Repository;
using System.Linq;
namespace Mall.Module.User
{
......@@ -187,14 +188,23 @@ namespace Mall.Module.User
/// 根据编号获取小程序信息
/// </summary>
/// <param name="MallBaseId">小程序Id</param>
/// <param name="isGetNav">是否获取顶部底部配置+底部标签导航(0-不获取,1-获取)</param>
/// <returns></returns>
public RB_MiniProgram_Extend GetMiniProgramModule(object MallBaseId)
public RB_MiniProgram_Extend GetMiniProgramModule(object MallBaseId,int isGetNav=0)
{
RB_MiniProgram_Extend extModel = programRepository.GetEntity<RB_MiniProgram_Extend>(MallBaseId);
if (extModel == null)
{
extModel = new RB_MiniProgram_Extend();
}
if (isGetNav == 1)
{
extModel.BottomTagList = bottomnavRepository.GetListRepository(new RB_Miniprogram_Bottomnav_Extend() { MallBaseId = extModel.MallBaseId });
if (extModel.BottomTagList != null && extModel.BottomTagList.Count > 0)
{
extModel.BottomTagList.FirstOrDefault().IsActive = true;
}
}
return extModel;
}
......@@ -248,7 +258,7 @@ namespace Mall.Module.User
{
{ nameof(RB_Miniprogram_Bottomnav_Extend.Status),1},
};
flag = programRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_Bottomnav_Extend.TagId), TagId));
flag = bottomnavRepository.Update(fileds, new WhereHelper(nameof(RB_Miniprogram_Bottomnav_Extend.TagId), TagId));
return flag;
}
}
......
......@@ -19,7 +19,7 @@ namespace Mall.Repository.User
public List<RB_Miniprogram_Bottomnav_Extend> GetListRepository(RB_Miniprogram_Bottomnav_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(" SELECT * FROM RB_Miniprogram_Bottomnav WHERE 1=1 ");
builder.Append(" SELECT * FROM RB_Miniprogram_Bottomnav WHERE 1=1 AND Status=0 ");
if (query != null)
{
if (query.TenantId != null && query.TenantId > 0)
......@@ -31,37 +31,8 @@ namespace Mall.Repository.User
builder.AppendFormat(" AND MallBaseId={0} ", query.MallBaseId);
}
}
builder.Append(" ORDER BY TagSort ");
return Get<RB_Miniprogram_Bottomnav_Extend>(builder.ToString()).ToList();
}
/// <summary>
/// 获取小程序分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_Miniprogram_Bottomnav_Extend> GetPageListRepository(int pageIndex, int pageSize, out long rowCount, RB_Miniprogram_Bottomnav_Extend query)
{
StringBuilder builder = new StringBuilder();
builder.Append(@"
SELECT A.*,B.Account,B.MobilePhone
FROM RB_Miniprogram_Bottomnav AS A LEFT JOIN RB_Tenant AS B ON A.TenantId=B.TenantId
WHERE 1=1 ");
if (query != null)
{
if (query.Status >= 0)
{
builder.AppendFormat(" AND A.Status={0} ", query.Status);
}
if (query.TenantId != null && query.TenantId > 0)
{
builder.AppendFormat(" AND A.TenantId={0} ", query.TenantId);
}
}
return GetPage<RB_Miniprogram_Bottomnav_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
}
}
......@@ -293,9 +293,8 @@ namespace Mall.WebApi.Controllers.User
var extModel = JsonConvert.DeserializeObject<RB_MiniProgram_Extend>(RequestParm.msg.ToString());
extModel.MallBaseId = RequestParm.MallBaseId;
extModel.TenantId = RequestParm.TenantId;
var flag = programModule.SetMiniProgramMallTagModule(extModel);
var flag = programModule.SetMiniProgramMallTagModule(extModel, isUpdateBasic: true);
return flag ? ApiResult.Success() : ApiResult.Failed();
}
/// <summary>
......@@ -318,7 +317,8 @@ namespace Mall.WebApi.Controllers.User
{
JObject parms = JObject.Parse(RequestParm.msg.ToString());
var MallBaseId = parms.GetInt("MallBaseId", 0);
var extModel = programModule.GetMiniProgramModule(MallBaseId);
int isGetNav = parms.GetInt("isGetNav", 0);
var extModel = programModule.GetMiniProgramModule(MallBaseId,isGetNav:isGetNav);
return ApiResult.Success(data: extModel);
}
......
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