| | |
| | | } |
| | | |
| | | func (m *GVA_MODEL) AfterFind(tx *gorm.DB) (err error) { |
| | | if m.CreatedAt != nil { |
| | | m.FormattedCreatedAt = m.CreatedAt.Format("2006-01-02 15:04:05") |
| | | } else { |
| | | m.FormattedCreatedAt = "--" |
| | | } |
| | | if m.UpdatedAt != nil { |
| | | m.FormattedUpdatedAt = m.UpdatedAt.Format("2006-01-02 15:04:05") |
| | | m.FormattedUpdatedAt = "--" |
| | | } |
| | | |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | type PurchaseType struct { |
| | | ID uint `gorm:"primarykey"` // 主键ID |
| | | ID uint `gorm:"primarykey" json:"id,string"` // 主键ID |
| | | Name string `json:"name" form:"name" gorm:"type:varchar(255);not null;default '';comment:采购类型"` // 采购类型 |
| | | Sort int `json:"sort" form:"sort" gorm:"type:int(11);not null;default 0;comment:排序"` // 排序 |
| | | Pin bool `json:"pin" form:"pin" gorm:"type:tinyint(1);not null;default 0;comment:采购名称"` // 是否置顶 |