Browse Source

更新

master
huangjiajun 1 week ago
parent
commit
5f350a1a0c
2 changed files with 9 additions and 0 deletions
  1. +1
    -0
      src/dao/admin_bind_medium_dao.go
  2. +8
    -0
      src/implement/admin_bind_medium_implement.go

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

@@ -5,4 +5,5 @@ import "code.fnuoos.com/zhimeng/model.git/src/model"
type AdminBindMediumDao interface { type AdminBindMediumDao interface {
FindAll(adminId int) (list []model.AdminBindMedium) FindAll(adminId int) (list []model.AdminBindMedium)
FindMediumList(mediumId string, adminId, page, limit int) (list []model.AdminBindMedium, total int64, err error) FindMediumList(mediumId string, adminId, page, limit int) (list []model.AdminBindMedium, total int64, err error)
GetAdminByMediumId(adminId, mediumId int) (list *model.AdminBindMedium)
} }

+ 8
- 0
src/implement/admin_bind_medium_implement.go View File

@@ -23,6 +23,14 @@ func (a AdminBindMediumDb) FindAll(adminId int) (list []model.AdminBindMedium) {
} }
return 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) { 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) sess := a.Db.Where("admin_id=?", adminId).Desc("id").Limit(limit, (page-1)*limit)
if mediumId != "" { if mediumId != "" {


Loading…
Cancel
Save