Update dictType.go

This commit is contained in:
wenjianzhang authored and GitHub committed 2020-04-01 09:09:59 +08:00
1 parent 53caac5d74
commit be66509acd
1 file changed
+4 -4
+4 -4
View File
@@ -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
}