feat✨ gen中修改创建人和修改人为0
This commit is contained in:
1 parent
57067907d3
commit
3a4bfe915b
3 files changed
+11
-12
No files matched your search
@@ -41,8 +41,8 @@ type SysColumns struct {
|
||||
FkCol []SysColumns `gorm:"-" json:"fkCol"`
|
||||
FkLabelId string `gorm:"" json:"fkLabelId"`
|
||||
FkLabelName string `gorm:"size:255;" json:"fkLabelName"`
|
||||
CreateBy string `gorm:"column:create_by;size:128;" json:"createBy"`
|
||||
UpdateBy string `gorm:"column:update_By;size:128;" json:"updateBy"`
|
||||
CreateBy int `gorm:"column:create_by;size:20;" json:"createBy"`
|
||||
UpdateBy int `gorm:"column:update_By;size:20;" json:"updateBy"`
|
||||
|
||||
models.BaseModel
|
||||
}
|
||||
@@ -66,7 +66,7 @@ func (e *SysColumns) GetList(tx *gorm.DB) ([]SysColumns, error) {
|
||||
|
||||
func (e *SysColumns) Create(tx *gorm.DB) (SysColumns, error) {
|
||||
var doc SysColumns
|
||||
e.CreateBy = "1"
|
||||
e.CreateBy = 0
|
||||
result := tx.Table("sys_columns").Create(&e)
|
||||
if result.Error != nil {
|
||||
err := result.Error
|
||||
@@ -83,7 +83,7 @@ func (e *SysColumns) Update(tx *gorm.DB) (update SysColumns, err error) {
|
||||
|
||||
//参数1:是要修改的数据
|
||||
//参数2:是修改的数据
|
||||
e.UpdateBy = "1"
|
||||
e.UpdateBy = 0
|
||||
if err = tx.Table("sys_columns").Model(&update).Updates(&e).Error; err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user