|
@@ -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);
|