fix: 自定义指标标题更新时间字段类型不一致反序列错误
This commit is contained in:
@@ -11,7 +11,7 @@ type KpiCTitle struct {
|
||||
Status string `json:"status" gorm:"column:status"` // 0-Inactive/1-Active/2-Deleted
|
||||
Description string `json:"description" gorm:"column:description"`
|
||||
CreatedBy string `json:"createdBy" gorm:"column:created_by"`
|
||||
UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at"`
|
||||
UpdatedAt string `json:"updatedAt" gorm:"column:updated_at"`
|
||||
}
|
||||
|
||||
// TableName 表名称
|
||||
|
||||
@@ -208,7 +208,7 @@ func (r KpiCReport) TitleSelect(param model.KpiCTitle) []model.KpiCTitle {
|
||||
// TitleInsert 新增信息
|
||||
func (r KpiCReport) TitleInsert(param model.KpiCTitle) int64 {
|
||||
if param.CreatedBy != "" {
|
||||
param.UpdatedAt = time.Now().UnixMilli()
|
||||
param.UpdatedAt = time.Now().Format(time.DateTime)
|
||||
}
|
||||
param.Status = "1"
|
||||
tx := db.DB("").Create(¶m)
|
||||
@@ -223,7 +223,7 @@ func (r KpiCReport) TitleUpdate(param model.KpiCTitle) int64 {
|
||||
if param.ID <= 0 {
|
||||
return 0
|
||||
}
|
||||
param.UpdatedAt = time.Now().UnixMilli()
|
||||
param.UpdatedAt = time.Now().Format(time.DateTime)
|
||||
tx := db.DB("").Model(&model.KpiCTitle{})
|
||||
// 构建查询条件
|
||||
tx = tx.Where("id = ?", param.ID)
|
||||
|
||||
Reference in New Issue
Block a user