ソースを参照

更新

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


読み込み中…
キャンセル
保存