广告平台(总站长使用)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
860 B

  1. package implement
  2. import (
  3. "applet/app/db/dao"
  4. "applet/app/db/model"
  5. "applet/app/enum"
  6. "applet/app/utils/logx"
  7. "xorm.io/xorm"
  8. )
  9. func NewAgentPermissionGroupDb(engine *xorm.Engine) dao.AgentPermissionGroupDao {
  10. return &AgentPermissionGroupDb{Db: engine}
  11. }
  12. type AgentPermissionGroupDb struct {
  13. Db *xorm.Engine
  14. }
  15. func (a AgentPermissionGroupDb) FindAgentPermissionGroup() (*[]model.AgentPermissionGroup, error) {
  16. var mm []model.AgentPermissionGroup
  17. if err := a.Db.Where("state = ?", enum.PermissionGroupStateForNormal).Asc("id").Find(&mm); err != nil {
  18. return nil, logx.Error(err)
  19. }
  20. return &mm, nil
  21. }
  22. func (a AgentPermissionGroupDb) FindAgentPermissionGroupV2() (*[]model.AgentPermissionGroup, error) {
  23. var mm []model.AgentPermissionGroup
  24. if err := a.Db.Asc("id").Find(&mm); err != nil {
  25. return nil, logx.Error(err)
  26. }
  27. return &mm, nil
  28. }