mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
This commit is contained in:
parent
d4e3c1e660
commit
d5e07318ee
3 changed files with 57 additions and 29 deletions
|
|
@ -535,13 +535,13 @@ func GetChildBlocks(parentID, condition string) (ret []*Block) {
|
|||
return
|
||||
}
|
||||
|
||||
func GetAllChildBlocks(rootID, condition string) (ret []*Block) {
|
||||
func GetAllChildBlocks(rootIDs []string, condition string) (ret []*Block) {
|
||||
ret = []*Block{}
|
||||
sqlStmt := "SELECT * FROM blocks AS ref WHERE ref.root_id = ?"
|
||||
sqlStmt := "SELECT * FROM blocks AS ref WHERE ref.root_id IN ('" + strings.Join(rootIDs, "','") + "')"
|
||||
if "" != condition {
|
||||
sqlStmt += " AND " + condition
|
||||
}
|
||||
rows, err := query(sqlStmt, rootID)
|
||||
rows, err := query(sqlStmt)
|
||||
if nil != err {
|
||||
logging.LogErrorf("sql query [%s] failed: %s", sqlStmt, err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue