From 072a55db7c7ed7f9432ca12baa535d9c1a7c9070 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 23 Dec 2023 21:02:31 +0800 Subject: [PATCH] :art: Add Relation column to database table view https://github.com/siyuan-note/siyuan/issues/9888 --- kernel/model/attribute_view.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index 3fc696aa6..3f15a2561 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -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, }) } }