|
@@ -295,7 +295,7 @@ namespace GxPress.Service.Implement.Middle
|
|
|
try
|
|
|
{
|
|
|
using TransactionScope transactionScope = new TransactionScope();
|
|
|
- var middleIds = new List<int>();
|
|
|
+ var middleIds = request.MiddleIds;
|
|
|
//获取
|
|
|
await _middleRepository.GetAllMiddleChildrenByParentIdAsync(request.MiddleIds, middleIds);
|
|
|
request.MiddleIds = middleIds;
|
|
@@ -881,7 +881,7 @@ namespace GxPress.Service.Implement.Middle
|
|
|
public async Task<List<MiddleSearchFolderResult>> GetLatelyTopicFolderAsync(int userId)
|
|
|
{
|
|
|
//获取用户最近发布的话题
|
|
|
- var folderIds = await _noteRepository.GetLatelyFolderIdAsync(userId);
|
|
|
+ var folderIds = await _noteRepository.GetLatelyFolderIdAsync(userId, true);
|
|
|
var query = Q.NewQuery();
|
|
|
query.Where(nameof(Entity.Middle.Middle.AttributeValue), 2)
|
|
|
.Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Note.GetHashCode())
|
|
@@ -889,7 +889,20 @@ namespace GxPress.Service.Implement.Middle
|
|
|
.Where(nameof(Entity.Middle.Middle.IsDelete), false)
|
|
|
.WhereIn(nameof(Entity.Middle.Middle.Id), folderIds);
|
|
|
query.WhereIn(nameof(Entity.Middle.Middle.RoleId), new List<int>() { 1, 3 });
|
|
|
- var middles = await _middleRepository.FindAsync(query.OrderByDesc(nameof(Entity.Middle.Middle.CreatedDate)));
|
|
|
+ var models = await _middleRepository.FindAsync(query.OrderByDesc(nameof(Entity.Middle.Middle.CreatedDate)));
|
|
|
+ var middles = new List<Entity.Middle.Middle>();
|
|
|
+
|
|
|
+ foreach (var folderId in folderIds.Distinct())
|
|
|
+ {
|
|
|
+ foreach (var item in models)
|
|
|
+ {
|
|
|
+ if (item.Id == folderId)
|
|
|
+ {
|
|
|
+ middles.Add(item);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
List<MiddleSearchFolderResult> result = new List<MiddleSearchFolderResult>();
|
|
|
foreach (var item in middles)
|
|
|
{
|
|
@@ -925,7 +938,7 @@ namespace GxPress.Service.Implement.Middle
|
|
|
public async Task<List<MiddleSearchFolderResult>> GetLatelyNoteFolderAsync(int userId)
|
|
|
{
|
|
|
//获取用户最近发布的话题
|
|
|
- var folderIds = await _noteRepository.GetLatelyFolderIdAsync(userId);
|
|
|
+ var folderIds = await _noteRepository.GetLatelyFolderIdAsync(userId, false);
|
|
|
var query = Q.NewQuery();
|
|
|
query.Where(nameof(Entity.Middle.Middle.AttributeValue), 2)
|
|
|
.Where(nameof(Entity.Middle.Middle.FolderType), AllTypeConst.Note.GetHashCode())
|
|
@@ -933,7 +946,19 @@ namespace GxPress.Service.Implement.Middle
|
|
|
.Where(nameof(Entity.Middle.Middle.IsDelete), false)
|
|
|
.WhereIn(nameof(Entity.Middle.Middle.Id), folderIds);
|
|
|
query.WhereIn(nameof(Entity.Middle.Middle.RoleId), new List<int>() { 2 });
|
|
|
- var middles = await _middleRepository.FindAsync(query.OrderByDesc(nameof(Entity.Middle.Middle.CreatedDate)));
|
|
|
+ var models = await _middleRepository.FindAsync(query.OrderByDesc(nameof(Entity.Middle.Middle.CreatedDate)));
|
|
|
+ var middles = new List<Entity.Middle.Middle>();
|
|
|
+ foreach (var folderId in folderIds.Distinct())
|
|
|
+ {
|
|
|
+ foreach (var item in models)
|
|
|
+ {
|
|
|
+ if (item.Id == folderId)
|
|
|
+ {
|
|
|
+ middles.Add(item);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
List<MiddleSearchFolderResult> result = new List<MiddleSearchFolderResult>();
|
|
|
foreach (var item in middles)
|
|
|
{
|