mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +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
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue