🎨 The database rollup field supports using the updated/created field https://github.com/siyuan-note/siyuan/issues/15662

This commit is contained in:
Daniel 2025-08-22 21:45:15 +08:00
parent 9bb6f4d134
commit c2075e6387
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
3 changed files with 5 additions and 5 deletions

View file

@ -800,7 +800,7 @@ func (r *ValueRollup) BuildContents(keyValues []*KeyValues, destKey *Key, relati
r.Contents = nil
for _, blockID := range relationVal.Relation.BlockIDs {
destVal := GetValue(keyValues, destKey.ID, blockID)
if nil != furtherCollection && KeyTypeTemplate == destKey.Type {
if nil != furtherCollection && (KeyTypeTemplate == destKey.Type || KeyTypeUpdated == destKey.Type || KeyTypeCreated == destKey.Type) {
destVal = furtherCollection.GetValue(blockID, destKey.ID)
}

View file

@ -1551,9 +1551,9 @@ func GetBlockAttributeViewKeys(nodeID string) (ret []*BlockAttributeViewKeys) {
destKey, _ := destAv.GetKey(kv.Key.Rollup.KeyID)
if nil != destKey {
isSameAv := destAv.ID == attrView.ID
var furtherCollection av.Collection
if av.KeyTypeTemplate == destKey.Type {
// 渲染目标视图,这样才能汇总渲染后的模板字段值
if av.KeyTypeTemplate == destKey.Type || (!isSameAv && (av.KeyTypeUpdated == destKey.Type || av.KeyTypeCreated == destKey.Type)) {
viewable := sql.RenderView(destAv, destAv.Views[0], "")
if nil != viewable {
furtherCollection = viewable.(av.Collection)

View file

@ -437,9 +437,9 @@ func fillAttributeViewAutoGeneratedValues(attrView *av.AttributeView, collection
break
}
isSameAv := destAv.ID == attrView.ID
var furtherCollection av.Collection
if av.KeyTypeTemplate == destKey.Type {
// 渲染目标视图,这样才能汇总渲染后的模板字段值
if av.KeyTypeTemplate == destKey.Type || (!isSameAv && (av.KeyTypeUpdated == destKey.Type || av.KeyTypeCreated == destKey.Type)) {
viewable := renderView(destAv, destAv.Views[0], "", depth, renderedAttrViews)
if nil != viewable {
furtherCollection = viewable.(av.Collection)