model.go 619 B

1234567891011121314151617181920
  1. package yb_price_driven
  2. import "hongze/hongze_yb/global"
  3. // GetPriceDrivenByVarietyTagId 通过标签获取价格驱动
  4. func GetPriceDrivenByVarietyTagId(varietyTagId int) (item *YbPriceDriven, err error) {
  5. err = global.DEFAULT_MYSQL.
  6. Where("variety_tag_id = ? AND publish_state = 1", varietyTagId).
  7. Order("create_time DESC").
  8. First(&item).Error
  9. return
  10. }
  11. // GetPriceDrivenById 主键获取价格驱动
  12. func GetPriceDrivenById(priceDrivenId int) (item *YbPriceDriven, err error) {
  13. err = global.DEFAULT_MYSQL.
  14. Where("price_driven_id = ? AND publish_state = 1", priceDrivenId).
  15. First(&item).Error
  16. return
  17. }