mirror of
https://gitee.com/johng/gf.git
synced 2024-11-29 18:57:44 +08:00
database/gdb/gdb_model_soft_time: fix soft-time support fieldType:LocalTypeUint64
in Insert/Update perations (#3551)
This commit is contained in:
parent
5b7cae78bc
commit
9aa426a105
@ -333,7 +333,7 @@ func (m *softTimeMaintainer) getConditionByFieldNameAndTypeForSoftDeleting(
|
||||
switch fieldType {
|
||||
case LocalTypeDate, LocalTypeDatetime:
|
||||
return fmt.Sprintf(`%s IS NULL`, quotedFieldName)
|
||||
case LocalTypeInt, LocalTypeUint, LocalTypeInt64, LocalTypeBool:
|
||||
case LocalTypeInt, LocalTypeUint, LocalTypeInt64, LocalTypeUint64, LocalTypeBool:
|
||||
return fmt.Sprintf(`%s=0`, quotedFieldName)
|
||||
default:
|
||||
intlog.Errorf(
|
||||
@ -372,7 +372,7 @@ func (m *softTimeMaintainer) GetValueByFieldTypeForCreateOrUpdate(
|
||||
switch fieldType {
|
||||
case LocalTypeDate, LocalTypeDatetime:
|
||||
value = gtime.Now()
|
||||
case LocalTypeInt, LocalTypeUint, LocalTypeInt64:
|
||||
case LocalTypeInt, LocalTypeUint, LocalTypeInt64, LocalTypeUint64:
|
||||
value = gtime.Timestamp()
|
||||
case LocalTypeBool:
|
||||
value = 1
|
||||
|
Loading…
Reference in New Issue
Block a user