From be66509acda6a691ddf2ca692b7d1a0cf07d4ab2 Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Wed, 1 Apr 2020 09:09:59 +0800 Subject: [PATCH] Update dictType.go --- models/dictType.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/dictType.go b/models/dictType.go index 583efa6..59c93d1 100644 --- a/models/dictType.go +++ b/models/dictType.go @@ -3,7 +3,6 @@ package models import ( orm "go-admin/database" "go-admin/utils" - "time" ) type DictType struct { @@ -15,7 +14,7 @@ type DictType struct { //状态 Status string `gorm:"column:status" json:"status"` - DataScope string `gorm:"_" json:"dataScope"` + DataScope string `gorm:"-" json:"dataScope"` Params string `gorm:"column:params" json:"params"` //创建者 @@ -33,7 +32,8 @@ type DictType struct { func (e *DictType) Create() (DictType, error) { var doc DictType - e.CreateTime = time.Now().String() + e.CreateTime = utils.GetCurrntTime() + e.UpdateTime = utils.GetCurrntTime() result := orm.Eloquent.Table("sys_dict_type").Create(&e) if result.Error != nil { err := result.Error @@ -89,7 +89,7 @@ func (e *DictType) GetPage(pageSize int, pageIndex int) ([]DictType, int32, erro } func (e *DictType) Update(id int64) (update DictType, err error) { - e.UpdateTime = time.Now().String() + e.UpdateTime = utils.GetCurrntTime() if err = orm.Eloquent.Table("sys_dict_type").First(&update, id).Error; err != nil { return }