🎨 Backlink count at the doc block title including sub-blocks https://github.com/siyuan-note/siyuan/issues/13791

This commit is contained in:
Daniel
2025-01-14 21:02:42 +08:00
parent 632dcd08f3
commit 28df28a37e

View File

@@ -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)