Commit 7d4b5143 authored by 黄奎's avatar 黄奎

页面修改

parent 0d2f5ecb
......@@ -16,5 +16,10 @@ namespace Mall.Model.Extend.MarketingCenter
/// 分类Id
/// </summary>
public string QCateIds { get; set; }
/// <summary>
/// 分类列表
/// </summary>
public RB_Share_Category_Extend CateList { get; set; }
}
}
using Mall.Model.Entity.MarketingCenter;
using System;
using System.Collections.Generic;
using VT.FW.DB;
namespace Mall.Model.Extend.MarketingCenter
......@@ -41,5 +42,10 @@ namespace Mall.Model.Extend.MarketingCenter
return Convert.ToDateTime(this.CreateDate).ToString("yyyy-MM-dd HH:mm:ss");
}
}
/// <summary>
/// 分类列表
/// </summary>
public List<RB_Share_Category_Extend> CateList { get; set; }
}
}
\ No newline at end of file
......@@ -99,6 +99,11 @@ namespace Mall.Module.MarketingCenter
/// <returns></returns>
public List<RB_Share_Friend_Extend> GetShareFriendPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Share_Friend_Extend query)
{
var cateAllList = share_CategoryRepository.GetShareCategoryListRepository(new RB_Share_Category_Extend()
{
MallBaseId = query.MallBaseId,
TenantId = query.TenantId
});
if (query.CateId > 0)
{
var cateList = GetChildCategoryListModule(new RB_Share_Category_Extend() { QCateIds = query.CateId.ToString() });
......@@ -106,9 +111,27 @@ namespace Mall.Module.MarketingCenter
query.CateIds = string.Join(",", cateList.Select(qitem => qitem.Id));
}
var list = share_FriendRepository.GetShareFriendPageListRepository(pageIndex, pageSize, out rowsCount, query);
foreach (var item in list)
{
item.CateList = GetFatherList(cateAllList, item.CateId).OrderBy(qitem=>qitem.Level).ToList();
}
return list;
}
/// <summary>
/// 获取所有上级分类
/// </summary>
/// <param name="list"></param>
/// <param name="Id"></param>
/// <returns></returns>
public static IEnumerable<RB_Share_Category_Extend> GetFatherList(IList<RB_Share_Category_Extend> list, int Id)
{
var query = list.Where(p => p.Id == Id).ToList();
return query.ToList().Concat(query.ToList().SelectMany(t => GetFatherList(list, t.ParentId)));
}
/// <summary>
/// 获取分享详情列表
......
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