mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-25 16:34:06 +01:00
🎨 数据历史文档中支持操作类型过滤 https://github.com/siyuan-note/siyuan/issues/5754
This commit is contained in:
parent
b1552281c4
commit
4908d84d2d
4 changed files with 13 additions and 6 deletions
|
|
@ -264,14 +264,21 @@ type HistoryItem struct {
|
|||
|
||||
func FullTextSearchHistory(query, box, op string, typ, page int) (ret []*History, pageCount, totalCount int) {
|
||||
query = gulu.Str.RemoveInvisible(query)
|
||||
query = stringQuery(query)
|
||||
if "" != query {
|
||||
query = stringQuery(query)
|
||||
}
|
||||
|
||||
pageSize := 32
|
||||
from := (page - 1) * pageSize
|
||||
to := page * pageSize
|
||||
|
||||
table := "histories_fts_case_insensitive"
|
||||
stmt := "SELECT * FROM " + table + " WHERE " + table + " MATCH '{title content}:(" + query + ")'"
|
||||
stmt := "SELECT * FROM " + table + " WHERE "
|
||||
if "" != query {
|
||||
stmt += table + " MATCH '{title content}:(" + query + ")'"
|
||||
} else {
|
||||
stmt += "1=1"
|
||||
}
|
||||
if "all" != op {
|
||||
stmt += " AND op = '" + op + "'"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue