智慧食堂
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.

25 regels
576 B

  1. package db
  2. import (
  3. "applet/app/admin/enum"
  4. "applet/app/db/model"
  5. "applet/app/utils/logx"
  6. "xorm.io/xorm"
  7. )
  8. type PermissionGroupDb struct {
  9. Db *xorm.Engine `json:"db"`
  10. }
  11. func (permissionGroupDb *PermissionGroupDb) Set() { // set方法
  12. permissionGroupDb.Db = Db
  13. }
  14. func (permissionGroupDb *PermissionGroupDb) FindPermissionGroup() (*[]model.PermissionGroup, error) {
  15. var m []model.PermissionGroup
  16. if err := permissionGroupDb.Db.Where("state = ?", enum.PermissionGroupStateForNormal).Asc("id").Find(&m); err != nil {
  17. return nil, logx.Error(err)
  18. }
  19. return &m, nil
  20. }