🎨 Add Relation column to database table view https://github.com/siyuan-note/siyuan/issues/9888

This commit is contained in:
Daniel 2023-12-23 21:02:31 +08:00
parent fb72af192e
commit 072a55db7c
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -49,6 +49,7 @@ type SearchAttributeViewResult struct {
AvID string `json:"avID"`
AvName string `json:"avName"`
BlockID string `json:"blockID"`
HPath string `json:"hPath"`
}
func SearchAttributeView(keyword string, page int, pageSize int) (ret []*SearchAttributeViewResult, pageCount int) {
@ -102,11 +103,19 @@ func SearchAttributeView(keyword string, page int, pageSize int) (ret []*SearchA
break
}
}
var hPath string
baseBlock := treenode.GetBlockTreeRootByPath(node.Box, node.Path)
if nil != baseBlock {
hPath = baseBlock.HPath
}
if !exist {
ret = append(ret, &SearchAttributeViewResult{
AvID: avID,
AvName: attrView.Name,
BlockID: block.ID,
HPath: hPath,
})
}
}