classify_menu.go 814 B

1234567891011121314151617181920212223242526
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // ClassifyMenu 报告分类-子目录表
  7. type ClassifyMenu struct {
  8. MenuId int `orm:"column(menu_id);pk"`
  9. MenuName string `description:"子目录名称"`
  10. ClassifyId int `description:"一级分类ID"`
  11. Sort int `description:"排序"`
  12. CreateTime time.Time `json:"-" description:"创建时间"`
  13. ModifyTime time.Time `json:"-" description:"更新时间"`
  14. }
  15. // GetClassifyMenuList 获取子目录列表
  16. func GetClassifyMenuList(condition string, pars []interface{}) (list []*ClassifyMenu, err error) {
  17. o := orm.NewOrmUsingDB("rddp")
  18. sql := `SELECT * FROM classify_menu WHERE 1 = 1 `
  19. sql += condition
  20. sql += ` ORDER BY sort ASC, create_time ASC`
  21. _, err = o.Raw(sql, pars).QueryRows(&list)
  22. return
  23. }