Commit 157f7371 authored by 黄奎's avatar 黄奎

页面修改

parent c97527f9
...@@ -68,5 +68,20 @@ namespace Mall.Model.Extend.MarketingCenter ...@@ -68,5 +68,20 @@ namespace Mall.Model.Extend.MarketingCenter
/// 商品名称 /// 商品名称
/// </summary> /// </summary>
public string GoodsName { get; set; } public string GoodsName { get; set; }
/// <summary>
/// 一级分类名称
/// </summary>
public string FirstLevelName { get; set; }
/// <summary>
/// 二级分类名称
/// </summary>
public string SecondLevelName { get; set; }
/// <summary>
/// 三级分类名称
/// </summary>
public string ThirdLevelName { get; set; }
} }
} }
\ No newline at end of file
...@@ -271,6 +271,18 @@ namespace Mall.Module.MarketingCenter ...@@ -271,6 +271,18 @@ namespace Mall.Module.MarketingCenter
public RB_Share_Friend_Extend GetShareFriendModule(object Id) public RB_Share_Friend_Extend GetShareFriendModule(object Id)
{ {
var extModel = share_FriendRepository.GetShareFriendEntityRepository(new RB_Share_Friend_Extend() { Id = Convert.ToInt32(Id) }); var extModel = share_FriendRepository.GetShareFriendEntityRepository(new RB_Share_Friend_Extend() { Id = Convert.ToInt32(Id) });
if (extModel != null)
{
var cateAllList = share_CategoryRepository.GetShareCategoryListRepository(new RB_Share_Category_Extend()
{
MallBaseId = extModel.MallBaseId,
TenantId = extModel.TenantId
});
var list = GetFatherList(cateAllList, extModel.CateId).OrderBy(qitem => qitem.Level).ToList();
extModel.FirstLevelName = list.Where(qitem => qitem.Level == 1)?.FirstOrDefault()?.Name ?? "";
extModel.SecondLevelName = list.Where(qitem => qitem.Level == 2)?.FirstOrDefault()?.Name ?? "";
extModel.ThirdLevelName = list.Where(qitem => qitem.Level == 3)?.FirstOrDefault()?.Name ?? "";
}
return extModel; return extModel;
} }
......
...@@ -102,15 +102,25 @@ WHERE 1=1 AND Status=0 ...@@ -102,15 +102,25 @@ WHERE 1=1 AND Status=0
public List<RB_Share_Category_Extend> GetChildCategoryListRepository(RB_Share_Category_Extend query) public List<RB_Share_Category_Extend> GetChildCategoryListRepository(RB_Share_Category_Extend query)
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
// builder.AppendFormat(@"
//SELECT tabA.*
//FROM (SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId>0) tabA,
// (SELECT @pid := '{0}') pd
//WHERE FIND_IN_SET(ParentId, @pid) > 0 AND @pid := concat(@pid, ',', id)
//UNION
//SELECT *
//FROM rb_share_category
//WHERE `Status`=0 AND FIND_IN_SET(Id,@pid) > 0 ",query.QCateIds);
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT tabA.* SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId IN({0})
FROM (SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId>0) tabA, UNION ALL
(SELECT @pid := '{0}') pd SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId IN(SELECT Id FROM rb_share_category WHERE `Status`=0 AND ParentId IN({0}) )
WHERE FIND_IN_SET(ParentId, @pid) > 0 AND @pid := concat(@pid, ',', id) UNION ALL
UNION SELECT * FROM rb_share_category WHERE `Status`=0 AND ParentId IN(SELECT Id FROM rb_share_category WHERE `Status`=0 AND ParentId IN( SELECT Id FROM rb_share_category WHERE `Status`=0 AND ParentId IN({0})) )
SELECT * UNION ALL
FROM rb_share_category SELECT * FROM rb_share_category WHERE `Status`=0 AND Id IN({0})
WHERE `Status`=0 AND FIND_IN_SET(Id,@pid) > 0 ",query.QCateIds); ", query.QCateIds);
return Get<RB_Share_Category_Extend>(builder.ToString()).ToList(); return Get<RB_Share_Category_Extend>(builder.ToString()).ToList();
} }
} }
......
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