Update config.go

This commit is contained in:
wenjianzhang authored and GitHub committed 2020-03-31 21:42:24 +08:00
1 parent 133eaf088d
commit 8240adafb0
1 file changed
+2 -1
+2 -1
View File
@@ -24,7 +24,7 @@ type Config struct {
CreateTime string `json:"createTime" gorm:"column:create_time"` CreateTime string `json:"createTime" gorm:"column:create_time"`
UpdateBy string `json:"updateBy" gorm:"column:update_by"` UpdateBy string `json:"updateBy" gorm:"column:update_by"`
UpdateTime string `json:"updateTime" gorm:"column:update_time"` UpdateTime string `json:"updateTime" gorm:"column:update_time"`
DataScope string `json:"dataScope" gorm:"_"` DataScope string `json:"dataScope" gorm:"-"`
Params string `json:"params" gorm:"column:params"` Params string `json:"params" gorm:"column:params"`
IsDel string `json:"isDel" gorm:"column:is_del"` IsDel string `json:"isDel" gorm:"column:is_del"`
} }
@@ -34,6 +34,7 @@ func (e *Config) Create() (Config, error) {
var doc Config var doc Config
doc.IsDel = "0" doc.IsDel = "0"
e.CreateTime = utils.GetCurrntTime() e.CreateTime = utils.GetCurrntTime()
e.UpdateTime = utils.GetCurrntTime()
result := orm.Eloquent.Table("sys_config").Create(&e) result := orm.Eloquent.Table("sys_config").Create(&e)
if result.Error != nil { if result.Error != nil {
err := result.Error err := result.Error