🎨 Improve database null value field sorting Fix https://github.com/siyuan-note/siyuan/issues/10951
This commit is contained in:
parent
5e116a16d2
commit
59d7b4dfc5
4 changed files with 7 additions and 7 deletions
|
@ -431,7 +431,7 @@ func SaveAttributeView(av *AttributeView) (err error) {
|
|||
}
|
||||
|
||||
if 0 == v.UpdatedAt {
|
||||
v.UpdatedAt = v.CreatedAt + 1000
|
||||
v.UpdatedAt = v.CreatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,9 +74,9 @@ func (value *Value) Compare(other *Value, attrView *AttributeView) int {
|
|||
return 0
|
||||
} else {
|
||||
if !other.Number.IsNotEmpty {
|
||||
return 0
|
||||
return 1
|
||||
}
|
||||
return 1
|
||||
return 0
|
||||
}
|
||||
}
|
||||
case KeyTypeDate:
|
||||
|
@ -94,9 +94,9 @@ func (value *Value) Compare(other *Value, attrView *AttributeView) int {
|
|||
return 0
|
||||
} else {
|
||||
if !other.Date.IsNotEmpty {
|
||||
return 0
|
||||
return 1
|
||||
}
|
||||
return 1
|
||||
return 0
|
||||
}
|
||||
}
|
||||
case KeyTypeCreated:
|
||||
|
|
|
@ -774,7 +774,7 @@ func renderAttributeView(attrView *av.AttributeView, viewID, query string, page,
|
|||
}
|
||||
|
||||
if 0 == v.UpdatedAt {
|
||||
v.UpdatedAt = v.CreatedAt + 1000
|
||||
v.UpdatedAt = v.CreatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -954,7 +954,7 @@ func GetAttributeViewDefaultValue(valueID, keyID, blockID string, typ av.KeyType
|
|||
ret.CreatedAt = time.Now().UnixMilli()
|
||||
}
|
||||
if 0 == ret.UpdatedAt {
|
||||
ret.UpdatedAt = ret.CreatedAt + 1000
|
||||
ret.UpdatedAt = ret.CreatedAt
|
||||
}
|
||||
|
||||
switch typ {
|
||||
|
|
Loading…
Add table
Reference in a new issue