longzhong.go 630 B

123456789101112131415161718
  1. package models
  2. import "github.com/beego/beego/v2/client/orm"
  3. func GetLongzhonginfoByClassifyId(classifyId int) (items []*Longzhonginfo, err error) {
  4. sql := `SELECT * FROM longzhonginfo WHERE classify_id=? ORDER BY longzhonginfo_id ASC `
  5. o := orm.NewOrmUsingDB("edb")
  6. _, err = o.Raw(sql, classifyId).QueryRows(&items)
  7. return
  8. }
  9. func GetLongzhongpriceinfoByClassifyName(productName string) (items []*Longzhongpriceinfo, err error) {
  10. sql := `SELECT * FROM longzhongpriceinfo WHERE product_name=? ORDER BY longzhongpriceinfo_id ASC `
  11. o := orm.NewOrmUsingDB("edb")
  12. _, err = o.Raw(sql, productName).QueryRows(&items)
  13. return
  14. }