🐛 Abnormal sorting of database relation fields https://github.com/siyuan-note/siyuan/issues/10835

This commit is contained in:
Daniel 2024-04-03 10:54:23 +08:00
parent 5e95593f51
commit eae61fd4a7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
4 changed files with 16 additions and 14 deletions

View file

@ -57,6 +57,13 @@ type Value struct {
Rollup *ValueRollup `json:"rollup,omitempty"`
}
func (value *Value) SetUpdatedAt(mills int64) {
value.UpdatedAt = mills
if value.CreatedAt == value.UpdatedAt {
value.UpdatedAt += 1000 // 防止更新时间和创建时间一样
}
}
func (value *Value) String() string {
if nil == value {
return ""
@ -198,9 +205,8 @@ func (value *Value) IsEdited() bool {
return true
}
if value.IsEmpty() {
// 空数据认为是未编辑过的
return false
if !value.IsEmpty() {
return true
}
return value.CreatedAt != value.UpdatedAt
}