🎨 Support for opening file history on the doc tree https://github.com/siyuan-note/siyuan/issues/8448

This commit is contained in:
Daniel 2023-06-03 22:56:26 +08:00
parent 5f8b71f566
commit 572951e8d4
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -370,7 +370,7 @@ func buildSearchHistoryQueryFilter(query, op, box, table string, typ int) (stmt
case HistoryTypeDoc:
stmt += table + " MATCH '{title content}:(" + query + ")'"
case HistoryTypeDocID:
stmt += table + " id = '" + query + "'"
stmt += " id = '" + query + "'"
case HistoryTypeAsset:
stmt += table + " MATCH '{title content}:(" + query + ")'"
}
@ -378,14 +378,12 @@ func buildSearchHistoryQueryFilter(query, op, box, table string, typ int) (stmt
stmt += "1=1"
}
if HistoryTypeDocName == typ || HistoryTypeDoc == typ || HistoryTypeDocID == typ {
if HistoryTypeDocName == typ || HistoryTypeDoc == typ {
if "all" != op {
stmt += " AND op = '" + op + "'"
}
if HistoryTypeDocName == typ || HistoryTypeDoc == typ {
stmt += " AND path LIKE '%/" + box + "/%' AND path LIKE '%.sy'"
} else if HistoryTypeDocID == typ {
stmt += " AND id = '" + query + "'"
}
} else if HistoryTypeAsset == typ {
stmt += " AND path LIKE '%/assets/%'"