李昊 4 年之前
父節點
當前提交
b5b1308ab5

+ 2 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Reply/ReplyService.Note.Topic.cs

@@ -22,7 +22,7 @@ namespace GxPress.Service.Implement.Reply
         /// <returns></returns>
         public async Task<IEnumerable<ReplyResult>> GetReplyNoteOrTopicResults(ReplyRequest request)
         {
-            var noteConstValue = AllTypeConst.Note.GetHashCode();
+            var noteConstValue = AllTypeConst.TopicNote.GetHashCode();
             string sqlStr = string.Empty;
             if (!string.IsNullOrEmpty(request.KeyWord))
             {
@@ -60,6 +60,7 @@ namespace GxPress.Service.Implement.Reply
                                     WHERE
                                         1=1 AND a.TypeValue ={noteConstValue}
                                             AND b.IsDelete = 0
+                                            and b.IsTopic=1
                                             {sqlStr}
                                     ORDER BY a.CreatedDate DESC
           ";
@@ -176,7 +177,6 @@ namespace GxPress.Service.Implement.Reply
         /// <returns></returns>
         public async Task<IEnumerable<ReplyResult>> GetReplyNoticeTopicResults(ReplyRequest request)
         {
-            var topicConstValue = AllTypeConst.Topic.GetHashCode();
             string sqlStr = string.Empty;
             if (!string.IsNullOrEmpty(request.KeyWord))
             {

+ 5 - 3
gx_api/GxPress/Service/GxPress.Service.Implement/Reply/ReplyService.Praise.cs

@@ -21,7 +21,7 @@ namespace GxPress.Service.Implement.Reply
         /// <returns></returns>
         public async Task<IEnumerable<ReplyResult>> GetNotePraiseAsync(ReplyRequest request)
         {
-            var noteConstValue = AllTypeConst.Note.GetHashCode();
+            var topicNoteConstValue = AllTypeConst.TopicNote.GetHashCode();
             string sqlStr = string.Empty;
             if (!string.IsNullOrEmpty(request.KeyWord))
             {
@@ -54,10 +54,12 @@ namespace GxPress.Service.Implement.Reply
                                             INNER JOIN
                                         tede_middle e ON e.MiddleId = b.Id
                                     WHERE
-                                        a.TypeValue = 4 AND e.IsDelete = 0
+                                        a.TypeValue ={topicNoteConstValue} AND e.IsDelete = 0
                                             AND a.CommentId = 0
                                             AND e.UserId = b.UserId
-                                            AND a.AnalyzeType = 1 AND b.UserId ={request.UserId}
+                                            AND a.AnalyzeType = 1 
+                                            AND b.UserId ={request.UserId}
+                                            And b.IsTopic=1
                                             {sqlStr}
                                     ORDER BY a.CreatedDate DESC
                                             ";

+ 3 - 2
gx_api/GxPress/Service/GxPress.Service.Implement/Topic/TopicService.cs

@@ -394,6 +394,7 @@ namespace GxPress.Service.Implement.Topic
         }
         public async Task<string> AssembleSqlCount(TopicPageSearchRequest request)
         {
+            var topicTypeValue = GxPress.EnumConst.AllTypeConst.TopicNote.GetHashCode();
             var sql = $@"SELECT   count(1) FROM
                                                         tede_note a
                                                             INNER JOIN
@@ -401,7 +402,7 @@ namespace GxPress.Service.Implement.Topic
                                                             INNER JOIN
                                                         tede_middle c ON c.MiddleId = a.Id
                                                     WHERE
-                                                        c.FolderType = 4 AND a.IsTopic = 1 and c.IsDelete=0";
+                                                        c.FolderType = {topicTypeValue} AND a.IsTopic = 1 and c.IsDelete=0";
             if (request.UserId <= 0)
             {
                 sql += $@" AND c.ParentId IN (SELECT 
@@ -409,7 +410,7 @@ namespace GxPress.Service.Implement.Topic
                                                 FROM
                                                     tede_middle
                                                 WHERE
-                                                    FolderType = 4 AND AttributeValue = 2
+                                                    FolderType = {topicTypeValue} AND AttributeValue = 2
                                                         AND RoleId = 1)";
             }
             else