广告平台(总站长使用)
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
872 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 NewMediumPermissionGroupDb(engine *xorm.Engine) dao.MediumPermissionGroupDao {
  10. return &MediumPermissionGroupDb{Db: engine}
  11. }
  12. type MediumPermissionGroupDb struct {
  13. Db *xorm.Engine
  14. }
  15. func (m MediumPermissionGroupDb) FindMediumPermissionGroup() (*[]model.MediumPermissionGroup, error) {
  16. var mm []model.MediumPermissionGroup
  17. if err := m.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 (m MediumPermissionGroupDb) FindMediumPermissionGroupV2() (*[]model.MediumPermissionGroup, error) {
  23. var mm []model.MediumPermissionGroup
  24. if err := m.Db.Asc("id").Find(&mm); err != nil {
  25. return nil, logx.Error(err)
  26. }
  27. return &mm, nil
  28. }