Browse Source

更新

master
huangjiajun 1 month ago
parent
commit
24f4b79473
2 changed files with 12 additions and 0 deletions
  1. +1
    -0
      src/dao/medium_dao.go
  2. +11
    -0
      src/implement/medium_implement.go

+ 1
- 0
src/dao/medium_dao.go View File

@@ -15,6 +15,7 @@ type MediumDao interface {
GetMedium(id int) (m *model.Medium, err error) GetMedium(id int) (m *model.Medium, err error)
FindMediumRolePermissionGroup(id int) (list []*MediumWithRolePermissionGroup, total int64, err error) FindMediumRolePermissionGroup(id int) (list []*MediumWithRolePermissionGroup, total int64, err error)
FindSuperAdmin(username, memo string, page, limit int) (list []model.Medium, total int64, err error) FindSuperAdmin(username, memo string, page, limit int) (list []model.Medium, total int64, err error)
FindSuperAdminByMediumId(mediumId []int, page, limit int) (list []model.Medium, total int64, err error)
GetSuperAdmin(mediumId int) (list *model.Medium) GetSuperAdmin(mediumId int) (list *model.Medium)
} }




+ 11
- 0
src/implement/medium_implement.go View File

@@ -112,6 +112,17 @@ func (m MediumDb) FindSuperAdmin(username, memo string, page, limit int) (list [
} }
return return
} }
func (m MediumDb) FindSuperAdminByMediumId(mediumId []int, page, limit int) (list []model.Medium, total int64, err error) {
sess := m.Db.Where("is_super_administrator=1").Desc("id").Limit(limit, (page-1)*limit)
if len(mediumId) > 0 {
sess.In("medium_id", mediumId)
}
total, err = sess.FindAndCount(&list)
if err != nil {
return nil, 0, err
}
return
}
func (m MediumDb) GetSuperAdmin(mediumId int) (list *model.Medium) { func (m MediumDb) GetSuperAdmin(mediumId int) (list *model.Medium) {
list = new(model.Medium) list = new(model.Medium)
sess := m.Db.Where("is_super_administrator=1 and medium_id=?", mediumId) sess := m.Db.Where("is_super_administrator=1 and medium_id=?", mediumId)


Loading…
Cancel
Save