business_conf.go 865 B

12345678910111213141516171819202122232425262728293031
  1. package eta
  2. import (
  3. "eta/eta_email_analysis/global"
  4. "time"
  5. )
  6. // BusinessConf 商户配置表
  7. type BusinessConf struct {
  8. Id int `gorm:"column:id;primaryKey"`
  9. ConfKey string `gorm:"description:配置Key"`
  10. ConfVal string `gorm:"description:配置值"`
  11. ValType int `gorm:"description:1-字符串;2-数值;3-字符串数组;4-富文本;"`
  12. Necessary int `gorm:"description:是否必填:0-否;1-是"`
  13. Remark string `gorm:"description:备注"`
  14. CreateTime time.Time `gorm:"column:create_time"`
  15. }
  16. func (m *BusinessConf) TableName() string {
  17. return "business_conf"
  18. }
  19. func (m *BusinessConf) PrimaryId() string {
  20. return "id"
  21. }
  22. // getBykey
  23. func GetBusinessConfByKey(key string) (conf BusinessConf, err error) {
  24. err = global.MYSQL["hz_eta"].Model(&BusinessConf{}).Where("conf_key = ?", key).First(&conf).Error
  25. return
  26. }