package eta import ( "eta/eta_mini_ht_api/models" ) type ReportAuthor struct { Id int `gorm:"primaryKey;autoIncrement;column:id;comment:主键"` AuthorType int `gorm:"default:1;comment:'类型,1:中文;2:英文'"` ReportAuthor string `gorm:"type:varchar(50);default:''"` Enable bool `gorm:"default:1;comment:'是否启用,0:禁用,1:启用'"` IsDelete bool `gorm:"default:0;comment:'是否删除,0:未删除,1:已删除'"` } func (ra ReportAuthor) TableName() string { return "report_author" } func GetReportAuthorList() (authors []ReportAuthor, err error) { db := models.ETA() err = db.Model(&ReportAuthor{}).Where("author_type = ?", 1).Find(&authors).Error return }