package eta import ( "eta/eta_email_analysis/global" "time" ) // BusinessConf 商户配置表 type BusinessConf struct { Id int `gorm:"column:id;primaryKey"` ConfKey string `gorm:"description:配置Key"` ConfVal string `gorm:"description:配置值"` ValType int `gorm:"description:1-字符串;2-数值;3-字符串数组;4-富文本;"` Necessary int `gorm:"description:是否必填:0-否;1-是"` Remark string `gorm:"description:备注"` CreateTime time.Time `gorm:"column:create_time"` } func (m *BusinessConf) TableName() string { return "business_conf" } func (m *BusinessConf) PrimaryId() string { return "id" } // getBykey func GetBusinessConfByKey(key string) (conf BusinessConf, err error) { err = global.MYSQL["hz_eta"].Model(&BusinessConf{}).Where("conf_key = ?", key).First(&conf).Error return }