mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 02:40:54 +08:00
🎨 Backlink count at the doc block title including sub-blocks https://github.com/siyuan-note/siyuan/issues/13791
This commit is contained in:
parent
632dcd08f3
commit
28df28a37e
@ -362,9 +362,9 @@ func QueryRefIDsByDefID(defID string, containChildren bool) (refIDs []string) {
|
||||
var rows *sql.Rows
|
||||
var err error
|
||||
if containChildren {
|
||||
rows, err = query("SELECT block_id FROM refs WHERE def_block_root_id = ?", defID)
|
||||
rows, err = query("SELECT DISTINCT block_id FROM refs WHERE def_block_root_id = ?", defID)
|
||||
} else {
|
||||
rows, err = query("SELECT block_id FROM refs WHERE def_block_id = ?", defID)
|
||||
rows, err = query("SELECT DISTINCT block_id FROM refs WHERE def_block_id = ?", defID)
|
||||
}
|
||||
if err != nil {
|
||||
logging.LogErrorf("sql query failed: %s", err)
|
||||
|
Loading…
Reference in New Issue
Block a user