瀏覽代碼

更新

master
huangjiajun 1 月之前
父節點
當前提交
f90ad431fa
共有 4 個文件被更改,包括 10 次插入8 次删除
  1. +1
    -1
      src/dao/admin_bind_medium_dao.go
  2. +1
    -1
      src/dao/medium_dao.go
  3. +4
    -3
      src/implement/admin_bind_medium_implement.go
  4. +4
    -3
      src/implement/medium_implement.go

+ 1
- 1
src/dao/admin_bind_medium_dao.go 查看文件

@@ -4,5 +4,5 @@ import "code.fnuoos.com/zhimeng/model.git/src/model"

type AdminBindMediumDao interface {
FindAll(adminId int) (list []model.AdminBindMedium)
FindMediumList(mediumId []int, 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)
}

+ 1
- 1
src/dao/medium_dao.go 查看文件

@@ -15,7 +15,7 @@ type MediumDao interface {
GetMedium(id int) (m *model.Medium, err error)
FindMediumRolePermissionGroup(id int) (list []*MediumWithRolePermissionGroup, total int64, err error)
FindSuperAdmin(username, memo string, page, limit int) (list []model.Medium, total int64, err error)
FindSuperAdminByMediumId(mediumId []int, page, limit int) (list []model.Medium, total int64, err error)
FindSuperAdminByMediumId(mediumId string, page, limit int) (list []model.Medium, total int64, err error)
GetSuperAdmin(mediumId int) (list *model.Medium)
}



+ 4
- 3
src/implement/admin_bind_medium_implement.go 查看文件

@@ -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 {


+ 4
- 3
src/implement/medium_implement.go 查看文件

@@ -5,6 +5,7 @@ import (
"code.fnuoos.com/zhimeng/model.git/src/model"
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx"
"reflect"
"strings"
"xorm.io/xorm"
)

@@ -112,10 +113,10 @@ func (m MediumDb) FindSuperAdmin(username, memo string, page, limit int) (list [
}
return
}
func (m MediumDb) FindSuperAdminByMediumId(mediumId []int, page, limit int) (list []model.Medium, total int64, err error) {
func (m MediumDb) FindSuperAdminByMediumId(mediumId string, page, limit int) (list []model.Medium, total int64, err error) {
sess := m.Db.Where("is_super_administrator=1").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 {


Loading…
取消
儲存