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

24 regels
497 B

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