🎨 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:30:59 +08:00
parent ee95f9bf6f
commit 9bb6f4d134
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
6 changed files with 54 additions and 44 deletions

View file

@ -336,6 +336,8 @@ func fillAttributeViewBaseValue(baseValue *av.BaseValue, fieldID, itemID string,
func fillAttributeViewAutoGeneratedValues(attrView *av.AttributeView, collection av.Collection, ials map[string]map[string]string,
depth *int, renderedAttrViews map[string]*av.AttributeView) {
// 先渲染主键、创建时间、更新时间
for _, item := range collection.GetItems() {
for _, value := range item.GetValues() {
itemID := item.GetID()
@ -397,6 +399,7 @@ func fillAttributeViewAutoGeneratedValues(attrView *av.AttributeView, collection
}
}
// 再渲染汇总和关联
for _, item := range collection.GetItems() {
for _, value := range item.GetValues() {
itemID := item.GetID()
@ -446,7 +449,7 @@ func fillAttributeViewAutoGeneratedValues(attrView *av.AttributeView, collection
}
}
value.Rollup.BuildContents(destAv, destKey, relVal, rollupKey.Rollup.Calc, furtherCollection)
value.Rollup.BuildContents(destAv.KeyValues, destKey, relVal, rollupKey.Rollup.Calc, furtherCollection)
case av.KeyTypeRelation: // 渲染关联
value.Relation.Contents = nil
relKey, _ := attrView.GetKey(value.KeyID)