ソースを参照

更新

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 {


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