mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 07:48:49 +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
2
app/stage/protyle/js/lute/lute.min.js
vendored
2
app/stage/protyle/js/lute/lute.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -7,7 +7,7 @@ require (
|
|||
github.com/88250/css v0.1.2
|
||||
github.com/88250/flock v0.8.2
|
||||
github.com/88250/gulu v1.2.3-0.20220720144315-065ef35ec583
|
||||
github.com/88250/lute v1.7.5-0.20220829043626-15605c5469b5
|
||||
github.com/88250/lute v1.7.5-0.20220829155050-5c5d032f7b68
|
||||
github.com/88250/melody v0.0.0-20201115062536-c0b3394adcd1
|
||||
github.com/88250/pdfcpu v0.3.13
|
||||
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
|
|||
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||
github.com/88250/gulu v1.2.3-0.20220720144315-065ef35ec583 h1:FhA/zJemLrbOYJpdMIMBezO5rGigQSdPR1kv+aztHfA=
|
||||
github.com/88250/gulu v1.2.3-0.20220720144315-065ef35ec583/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
|
||||
github.com/88250/lute v1.7.5-0.20220829043626-15605c5469b5 h1:3yiTbNZwo9fxEtcEiiJdXi+iMQo7skXPJ/RyWVhLJfY=
|
||||
github.com/88250/lute v1.7.5-0.20220829043626-15605c5469b5/go.mod h1:Bdu9LRNjQhtL3TftbtpjIWTwDVAXoS7AD8QsZQPk7zo=
|
||||
github.com/88250/lute v1.7.5-0.20220829155050-5c5d032f7b68 h1:BSVqhd18YpBEECvek7lJu13qcmQGJgQwaiLrnsUyRvw=
|
||||
github.com/88250/lute v1.7.5-0.20220829155050-5c5d032f7b68/go.mod h1:Bdu9LRNjQhtL3TftbtpjIWTwDVAXoS7AD8QsZQPk7zo=
|
||||
github.com/88250/melody v0.0.0-20201115062536-c0b3394adcd1 h1:9Cb+iN639vUI2OcIBc+4oGwml9/0J6bL6dWNb8Al+1s=
|
||||
github.com/88250/melody v0.0.0-20201115062536-c0b3394adcd1/go.mod h1:jH6MMPr8G7AMzaVmWHXZQiB1DKO3giWbcWZ7UoJ1teI=
|
||||
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=
|
||||
|
|
|
|||
|
|
@ -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