query.go 390 B

123456789101112131415161718
  1. package yb_suncode_pars
  2. import (
  3. "hongze/hongze_yb/global"
  4. )
  5. func (item *YbSuncodePars) Create() (err error) {
  6. err = global.DEFAULT_MYSQL.Create(item).Error
  7. return
  8. }
  9. // GetSceneByKey 获取太阳码参数
  10. func GetSceneByKey(key string) (item *YbSuncodePars, err error) {
  11. err = global.DEFAULT_MYSQL.Model(YbSuncodePars{}).
  12. Where("scene_key = ?", key).
  13. First(&item).Error
  14. return
  15. }