mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-05-08 03:39:15 -05:00
🎨 Improve database null value field sorting Fix https://github.com/siyuan-note/siyuan/issues/10951
This commit is contained in:
+1
-1
@@ -431,7 +431,7 @@ func SaveAttributeView(av *AttributeView) (err error) {
|
||||
}
|
||||
|
||||
if 0 == v.UpdatedAt {
|
||||
v.UpdatedAt = v.CreatedAt + 1000
|
||||
v.UpdatedAt = v.CreatedAt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user