|
|
@@ -23,6 +23,14 @@ func (a AdminBindMediumDb) FindAll(adminId int) (list []model.AdminBindMedium) { |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
func (a AdminBindMediumDb) GetAdminByMediumId(adminId, mediumId int) (list *model.AdminBindMedium) { |
|
|
|
sess := a.Db.Where("medium_id=? and admin_id=?", mediumId, adminId) |
|
|
|
get, err := sess.Get(&list) |
|
|
|
if get == false || err != nil { |
|
|
|
return nil |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
func (a AdminBindMediumDb) FindMediumList(mediumId string, adminId, page, limit int) (list []model.AdminBindMedium, total int64, err error) { |
|
|
|
sess := a.Db.Where("admin_id=?", adminId).Desc("id").Limit(limit, (page-1)*limit) |
|
|
|
if mediumId != "" { |
|
|
|