calendar.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package roadshow
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type Researcher struct {
  6. AdminId int `description:"研究员id"`
  7. RealName string `description:"研究员名称"`
  8. GroupId int `description:"分组id"`
  9. GroupName string `description:"分组名称"`
  10. RoleTypeCode string `description:"角色编码"`
  11. }
  12. type ResearcherGroup struct {
  13. GroupId int `description:"分组id"`
  14. GroupName string `description:"分组名称"`
  15. ResearcherList []*Researcher
  16. }
  17. func GetResearcherGroup() (list []*ResearcherGroup, err error) {
  18. o := orm.NewOrm()
  19. sql := ` SELECT group_id,group_name FROM admin AS a
  20. WHERE a.role_type_code IN('researcher','ficc_researcher','ficc_admin')
  21. AND a.enabled=1
  22. AND a.group_id>0
  23. AND a.group_name<>'无'
  24. GROUP BY a.group_id
  25. ORDER BY a.group_id ASC `
  26. _, err = o.Raw(sql).QueryRows(&list)
  27. return
  28. }
  29. func GetResearcher() (list []*Researcher, err error) {
  30. o := orm.NewOrm()
  31. //sql := ` SELECT * FROM admin AS a
  32. // WHERE a.role_type_code IN('researcher','rai_researcher','ficc_researcher','ficc_admin')
  33. // AND a.enabled=1 AND a.real_name<>'于菲' `
  34. sql := ` SELECT * FROM admin AS a WHERE a.enabled=1 `
  35. _, err = o.Raw(sql).QueryRows(&list)
  36. return
  37. }