lihao 4 년 전
부모
커밋
af97e54d5e
1개의 변경된 파일8개의 추가작업 그리고 3개의 파일을 삭제
  1. 8 3
      gx_api/GxPress/Repository/GxPress.Repository.Implement/Collection/CollectionRepository.cs

+ 8 - 3
gx_api/GxPress/Repository/GxPress.Repository.Implement/Collection/CollectionRepository.cs

@@ -86,12 +86,16 @@ namespace GxPress.Repository.Implement.Collection
                 query.Where(n => n.WhereIn("tede_middle.RoleId", new List<int> { MiddleRoleConst.Publicity.GetHashCode(), MiddleRoleConst.Share.GetHashCode() }).OrWhereIn("tede_middle.Id", folderUserQuery));
             }
             if (!string.IsNullOrEmpty(request.SearchKey) && request.FolderId == 0)
-                query.Where(n => n.OrWhereLike("tede_collection.Title", $"%{request.SearchKey}%").OrWhereLike("tede_middle.FolderName", $"%{request.SearchKey}%"));
+                query.Where(n => n.OrWhereLike("tede_collection.Title", $"%{request.SearchKey}%")
+                .OrWhereLike("tede_middle.FolderName", $"%{request.SearchKey}%")
+                .OrWhereLike("tede_collection.ResultJson", $"%{request.SearchKey}%"));
             else
             {
                 query.Where("tede_middle.ParentId", request.FolderId);
                 if (!string.IsNullOrEmpty(request.SearchKey))
-                    query.Where(n => n.OrWhereLike("tede_collection.Title", $"%{request.SearchKey}%").OrWhereLike("tede_middle.FolderName", $"%{request.SearchKey}%"));
+                    query.Where(n => n.OrWhereLike("tede_collection.Title", $"%{request.SearchKey}%")
+                    .OrWhereLike("tede_middle.FolderName", $"%{request.SearchKey}%")
+                    .OrWhereLike("tede_collection.ResultJson", $"%{request.SearchKey}%"));
             }
             result.Total = await _middleRepository.CountAsync(query);
             query.ForPage(request.Page, request.PerPage);
@@ -214,7 +218,8 @@ namespace GxPress.Repository.Implement.Collection
             var query = new SqlKata.Query("tede_collection");
             query.Join("tede_middle as a", "a.MiddleId", "tede_collection.Id");
             if (!string.IsNullOrEmpty(request.SearchKey))
-                query.WhereLike("tede_collection.Title", $"%{request.SearchKey}%");
+                query.Where(n => n.WhereLike("tede_collection.Title", $"%{request.SearchKey}%")
+                       .OrWhereLike("tede_collection.ResultJson", $"%{request.SearchKey}%"));
             query.Where("a.FolderType", collectionContsValue);
             query.Where("tede_collection.UserId", request.UserId);
             query.Where("a.IsDelete", false);