Daniel 2025-06-22 22:22:44 +08:00
parent 5faa2e4175
commit 421323164e
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 5 additions and 2 deletions

View file

@ -881,6 +881,9 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
}
if 0 < len(kValues.Values) {
for _, v := range kValues.Values {
sql.FillAttributeViewNilValue(v, v.Type)
}
keyValues = append(keyValues, kValues)
} else {
// 如果没有值,那么就补一个默认值

View file

@ -257,7 +257,7 @@ func fillAttributeViewBaseValue(baseValue *av.BaseValue, fieldID, itemID string,
if nil == baseValue.Value {
baseValue.Value = av.GetAttributeViewDefaultValue(baseValue.ID, fieldID, itemID, baseValue.ValueType)
} else {
fillAttributeViewNilValue(baseValue.Value, baseValue.ValueType)
FillAttributeViewNilValue(baseValue.Value, baseValue.ValueType)
}
}
@ -425,7 +425,7 @@ func fillAttributeViewTemplateValue(value *av.Value, item av.Item, attrView *av.
return
}
func fillAttributeViewNilValue(value *av.Value, typ av.KeyType) {
func FillAttributeViewNilValue(value *av.Value, typ av.KeyType) {
value.Type = typ
switch typ {
case av.KeyTypeText: