config.go 506 B

12345678910111213141516171819202122
  1. package cygx_config
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxConfig struct {
  7. ConfigId int `json:"-" orm:"column(config_id);pk"`
  8. ConfigCode string `json:"-"`
  9. ConfigValue string
  10. Remark string `json:"-"`
  11. CreateTime time.Time `json:"-"`
  12. }
  13. func GetConfigByCode(configCode string) (item *CygxConfig, err error) {
  14. o := orm.NewOrmUsingDB("hz_cygx")
  15. sql := `SELECT * FROM cygx_config WHERE config_code=? `
  16. err = o.Raw(sql, configCode).QueryRow(&item)
  17. return
  18. }