Update dictType.go
This commit is contained in:
1 parent
53caac5d74
commit
be66509acd
1 file changed
+4
-4
+4
-4
@@ -3,7 +3,6 @@ package models
|
|||||||
import (
|
import (
|
||||||
orm "go-admin/database"
|
orm "go-admin/database"
|
||||||
"go-admin/utils"
|
"go-admin/utils"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type DictType struct {
|
type DictType struct {
|
||||||
@@ -15,7 +14,7 @@ type DictType struct {
|
|||||||
//状态
|
//状态
|
||||||
Status string `gorm:"column:status" json:"status"`
|
Status string `gorm:"column:status" json:"status"`
|
||||||
|
|
||||||
DataScope string `gorm:"_" json:"dataScope"`
|
DataScope string `gorm:"-" json:"dataScope"`
|
||||||
|
|
||||||
Params string `gorm:"column:params" json:"params"`
|
Params string `gorm:"column:params" json:"params"`
|
||||||
//创建者
|
//创建者
|
||||||
@@ -33,7 +32,8 @@ type DictType struct {
|
|||||||
|
|
||||||
func (e *DictType) Create() (DictType, error) {
|
func (e *DictType) Create() (DictType, error) {
|
||||||
var doc DictType
|
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)
|
result := orm.Eloquent.Table("sys_dict_type").Create(&e)
|
||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
err := result.Error
|
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) {
|
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 {
|
if err = orm.Eloquent.Table("sys_dict_type").First(&update, id).Error; err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user