Ver código fonte

更新

master
huangjiajun 1 mês atrás
pai
commit
24f4b79473
2 arquivos alterados com 12 adições e 0 exclusões
  1. +1
    -0
      src/dao/medium_dao.go
  2. +11
    -0
      src/implement/medium_implement.go

+ 1
- 0
src/dao/medium_dao.go Ver arquivo

@@ -15,6 +15,7 @@ type MediumDao interface {
GetMedium(id int) (m *model.Medium, 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)
FindSuperAdminByMediumId(mediumId []int, page, limit int) (list []model.Medium, total int64, err error)
GetSuperAdmin(mediumId int) (list *model.Medium)
}



+ 11
- 0
src/implement/medium_implement.go Ver arquivo

@@ -112,6 +112,17 @@ func (m MediumDb) FindSuperAdmin(username, memo string, page, limit int) (list [
}
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) {
list = new(model.Medium)
sess := m.Db.Where("is_super_administrator=1 and medium_id=?", mediumId)


Carregando…
Cancelar
Salvar