李昊 4 years ago
parent
commit
2d81c97be5

+ 1 - 0
gx_api/GxPress/Model/GxPress.Request/App/Note/NoteSearchPageListRequest.cs

@@ -32,5 +32,6 @@ namespace GxPress.Request.App.Note
         /// </summary>
         /// <value></value>
         public int TypeValue { get; set; }
+        
     }
 }

+ 1 - 2
gx_api/GxPress/Model/GxPress.Result/App/Note/NotePageListRequest.cs

@@ -124,7 +124,6 @@ namespace GxPress.Result.App.Note
         public MediaNoteResult MediaNoteResult { get; set; }
 
         public int FolderId { get; set; }
-        public int FolderName { get; set; }
-
+        public string FolderParentName { get; set; }
     }
 }

+ 2 - 2
gx_api/GxPress/Repository/GxPress.Repository.Implement/Note/NoteRepository.cs

@@ -192,7 +192,7 @@ namespace GxPress.Repository.Implement.Note
             {
                 sql =
                     $@"SELECT  a.Id,a.MiddleId,a.RoleId,a.ParentId,a.AttributeValue,a.UserId,
-                      a.CreatedDate,a.IsTop,
+                      a.CreatedDate,a.IsTop,a.FolderName,a.FolderType,
                     (SELECT GROUP_CONCAT(SourceName Separator'、') from tede_user_middle where MiddleType={noteTypeId} 
                     and DataSourceId=a.MiddleSonId) as EnjoyUser,
                     (SELECT 
@@ -270,7 +270,7 @@ namespace GxPress.Repository.Implement.Note
                                     FROM
                                         tede_middle
                                     WHERE
-                                        MiddleId = a.Id AND FolderType ={noteTypeId})) AS FolderName,
+                                        MiddleId = a.Id AND FolderType ={noteTypeId})) AS FolderParentName,
                         (SELECT 
                                 Id
                             FROM

+ 5 - 1
gx_api/GxPress/Service/GxPress.Service.Implement/Note/NoteService.cs

@@ -174,6 +174,10 @@ namespace GxPress.Service.Implement.Note
             }
             foreach (var item in result.Items)
             {
+                if (!string.IsNullOrEmpty(item.FolderName))
+                    item.FolderId = item.Id;
+                if (!string.IsNullOrEmpty(item.FolderParentName))
+                    item.FolderName = item.FolderParentName;
                 //是否摘录
                 if (item.MediaId > 0)
                 {
@@ -497,7 +501,7 @@ namespace GxPress.Service.Implement.Note
             await _visitService.AddVisit(userId, 4, id);
             //是否自建
             result.IsAdmin = note.UserId == userId;
-            var praisePageSearchRequest = new PraisePageSearchRequest { SourceId = id, TypeValue =analyzeRequest.TypeValue, Page = 1, PerPage = 3 };
+            var praisePageSearchRequest = new PraisePageSearchRequest { SourceId = id, TypeValue = analyzeRequest.TypeValue, Page = 1, PerPage = 3 };
             result.NotePraisePagedList = await _analyzeService.GetPraisePageAsync(praisePageSearchRequest);
             return result;
         }