|
|
@@ -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) |
|
|
|