|
|
@@ -3,6 +3,7 @@ package implement |
|
|
|
import ( |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/dao" |
|
|
|
"code.fnuoos.com/zhimeng/model.git/src/model" |
|
|
|
"strings" |
|
|
|
"xorm.io/xorm" |
|
|
|
) |
|
|
|
|
|
|
@@ -22,10 +23,10 @@ func (a AdminBindMediumDb) FindAll(adminId int) (list []model.AdminBindMedium) { |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
func (a AdminBindMediumDb) FindMediumList(mediumId []int, 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) |
|
|
|
if len(mediumId) > 0 { |
|
|
|
sess.In("medium_id", mediumId) |
|
|
|
if mediumId != "" { |
|
|
|
sess.In("medium_id", strings.Split(mediumId, ",")) |
|
|
|
} |
|
|
|
total, err = sess.FindAndCount(&list) |
|
|
|
if err != nil { |
|
|
|