mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 15:10:12 +01:00
🎨 Improve blocktree
This commit is contained in:
parent
5f1999d68e
commit
a8b3f6cc25
1 changed files with 8 additions and 0 deletions
|
|
@ -306,6 +306,10 @@ func ExistBlockTree(id string) bool {
|
||||||
|
|
||||||
func ExistBlockTrees(ids []string) (ret map[string]bool) {
|
func ExistBlockTrees(ids []string) (ret map[string]bool) {
|
||||||
ret = map[string]bool{}
|
ret = map[string]bool{}
|
||||||
|
if 1 > len(ids) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for _, id := range ids {
|
for _, id := range ids {
|
||||||
ret[id] = false
|
ret[id] = false
|
||||||
}
|
}
|
||||||
|
|
@ -330,6 +334,10 @@ func ExistBlockTrees(ids []string) (ret map[string]bool) {
|
||||||
|
|
||||||
func GetBlockTrees(ids []string) (ret map[string]*BlockTree) {
|
func GetBlockTrees(ids []string) (ret map[string]*BlockTree) {
|
||||||
ret = map[string]*BlockTree{}
|
ret = map[string]*BlockTree{}
|
||||||
|
if 1 > len(ids) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
sqlStmt := "SELECT * FROM blocktrees WHERE id IN ('" + strings.Join(ids, "','") + "')"
|
sqlStmt := "SELECT * FROM blocktrees WHERE id IN ('" + strings.Join(ids, "','") + "')"
|
||||||
rows, err := db.Query(sqlStmt)
|
rows, err := db.Query(sqlStmt)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue