浏览代码

更新

master
huangjiajun 1周前
父节点
当前提交
5f350a1a0c
共有 2 个文件被更改,包括 9 次插入0 次删除
  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 查看文件

@@ -5,4 +5,5 @@ import "code.fnuoos.com/zhimeng/model.git/src/model"
type AdminBindMediumDao interface {
FindAll(adminId int) (list []model.AdminBindMedium)
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 查看文件

@@ -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 != "" {


正在加载...
取消
保存