Kaynağa Gözat

更新

master
huangjiajun 2 ay önce
ebeveyn
işleme
f120af0d8a
2 değiştirilmiş dosya ile 14 ekleme ve 2 silme
  1. +2
    -1
      src/dao/admin_role_dao.go
  2. +12
    -1
      src/implement/admin_role_implement.go

+ 2
- 1
src/dao/admin_role_dao.go Dosyayı Görüntüle

@@ -1,4 +1,4 @@
package dao
package dao

import (
"code.fnuoos.com/zhimeng/model.git/src/model"
@@ -10,6 +10,7 @@ type AdminRoleDao interface {
FindAdminRoleByRoleId(id int) (*[]model.AdminRole, error)
AdminDeleteBySessionForAdmId(session *xorm.Session, admId interface{}) (int64, error)
GetAdminRoleByRole(id int) (m *model.AdminRole, err error)
GetAdminRoleByAdminId(id int) (m *model.AdminRole, err error)
AdminRoleDeleteForRoleBySession(session *xorm.Session, roleId interface{}) (int64, error)
AdminRoleDeleteBySession(session *xorm.Session, id interface{}) (int64, error)
BatchAddAdminRoleBySession(session *xorm.Session, mm []*model.AdminRole) (int64, error)


+ 12
- 1
src/implement/admin_role_implement.go Dosyayı Görüntüle

@@ -1,4 +1,4 @@
package implement
package implement

import (
"code.fnuoos.com/zhimeng/model.git/src/dao"
@@ -51,6 +51,17 @@ func (a AdminRoleDb) GetAdminRoleByRole(id int) (m *model.AdminRole, err error)
}
return m, nil
}
func (a AdminRoleDb) GetAdminRoleByAdminId(id int) (m *model.AdminRole, err error) {
m = new(model.AdminRole)
has, err := a.Db.Where("adm_id =?", id).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (a AdminRoleDb) AdminRoleDeleteForRoleBySession(session *xorm.Session, roleId interface{}) (int64, error) {
if reflect.TypeOf(roleId).Kind() == reflect.Slice {


Yükleniyor…
İptal
Kaydet