mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 The database rollup field supports using the updated/created field https://github.com/siyuan-note/siyuan/issues/15662
This commit is contained in:
parent
ee95f9bf6f
commit
9bb6f4d134
6 changed files with 54 additions and 44 deletions
|
|
@ -79,6 +79,20 @@ func GetKeyBlockValue(blockKeyValues []*KeyValues) (ret *Value) {
|
|||
return
|
||||
}
|
||||
|
||||
func GetValue(keyValues []*KeyValues, keyID, itemID string) (ret *Value) {
|
||||
for _, kv := range keyValues {
|
||||
if kv.Key.ID == keyID {
|
||||
for _, v := range kv.Values {
|
||||
if v.BlockID == itemID {
|
||||
ret = v
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// KeyType 描述了属性视图属性字段的类型。
|
||||
type KeyType string
|
||||
|
||||
|
|
@ -565,15 +579,6 @@ func (av *AttributeView) GetCurrentView(viewID string) (ret *View, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func (av *AttributeView) ExistItem(itemID string) bool {
|
||||
for _, blockVal := range av.GetBlockKeyValues().Values {
|
||||
if blockVal.BlockID == itemID {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (av *AttributeView) ExistBoundBlock(nodeID string) bool {
|
||||
for _, blockVal := range av.GetBlockKeyValues().Values {
|
||||
if blockVal.Block.ID == nodeID {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue