classify.go 654 B

1234567891011121314151617181920212223
  1. package models
  2. import (
  3. "rdluck_tools/orm"
  4. "time"
  5. )
  6. type Classify struct {
  7. Id int `orm:"column(id);pk"`
  8. ClassifyName string `description:"分类名称"`
  9. Sort int `json:"-"`
  10. ParentId int `description:"父级分类id"`
  11. CreateTime time.Time `description:"创建时间"`
  12. ModifyTime time.Time `description:"修改时间"`
  13. Abstract string `description:"简介"`
  14. Descript string `description:"描述"`
  15. }
  16. func GetClassifyById(classifyId int) (item *Classify, err error) {
  17. sql := ` SELECT * FROM classify WHERE id = ? `
  18. err = orm.NewOrm().Raw(sql, classifyId).QueryRow(&item)
  19. return
  20. }