mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
🐛 Abnormal sorting of database relation fields https://github.com/siyuan-note/siyuan/issues/10835
This commit is contained in:
parent
5e95593f51
commit
eae61fd4a7
4 changed files with 16 additions and 14 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue