123456789101112131415161718192021222324252627282930
  1. package system
  2. import (
  3. "spaceofcheng/services/models"
  4. "spaceofcheng/services/models/model"
  5. "spaceofcheng/services/utils"
  6. "github.com/go-xorm/xorm"
  7. )
  8. // DictDAO 当前数据库操作对象
  9. type DictDAO struct {
  10. ctx *utils.Context
  11. db *xorm.Session
  12. }
  13. // NewDictDAO New Inst
  14. func NewDictDAO(ctx *utils.Context) *DictDAO {
  15. return &DictDAO{
  16. ctx: ctx,
  17. db: ctx.DB,
  18. }
  19. }
  20. // GetUserType 获取用户类型
  21. func (m *DictDAO) GetUserType() ([]model.TdUserType, error) {
  22. var usertype []model.TdUserType
  23. err := m.db.Where("status>?", models.STATUS_DEL).Find(&usertype)
  24. return usertype, err
  25. }