Bläddra i källkod

更新

master
huangjiajun 1 vecka sedan
förälder
incheckning
d373e08350
5 ändrade filer med 17 tillägg och 5 borttagningar
  1. +2
    -1
      src/dao/admin_dao.go
  2. +12
    -1
      src/implement/admin_implement.go
  3. +1
    -1
      src/super/implement/medium_bank_info_db.go
  4. +1
    -1
      src/super/implement/medium_contact_info_db.go
  5. +1
    -1
      src/super/implement/medium_list_implement.go

+ 2
- 1
src/dao/admin_dao.go Visa fil

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

import (
"code.fnuoos.com/zhimeng/model.git/src/model"
@@ -9,6 +9,7 @@ type AdminDao interface {
CreateAdminId() (admId int, err error)
AdminDeleteBySession(session *xorm.Session, admId interface{}) (int64, error)
GetAdmin(id int) (m *model.Admin, err error)
GetSuperAdmin() (m *model.Admin, err error)
GetAdminByUserName(userName string) (m *model.Admin, err error)
GetAdminRolePermission(admId int) (list []*AdminRolePermission, total int64, err error)
FindAdmin(username string, state, page, limit int) (list []model.Admin, total int64, err error)


+ 12
- 1
src/implement/admin_implement.go Visa fil

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

import (
"code.fnuoos.com/zhimeng/model.git/src/dao"
@@ -48,6 +48,17 @@ func (a AdminDb) GetAdmin(id int) (m *model.Admin, err error) {
}
return m, nil
}
func (a AdminDb) GetSuperAdmin() (m *model.Admin, err error) {
m = new(model.Admin)
has, err := a.Db.Where("is_super_administrator =?", 1).Get(m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
if has == false {
return nil, nil
}
return m, nil
}

func (a AdminDb) GetAdminByUserName(userName string) (m *model.Admin, err error) {
m = new(model.Admin)


+ 1
- 1
src/super/implement/medium_bank_info_db.go Visa fil

@@ -29,7 +29,7 @@ func (a MediumBankInfoDb) GetMediumBankInfoList(MediumId int) (medium *model.Med
func (a MediumBankInfoDb) FindMediumBankInfoList(uuid, name, state string, page, limit int) (list []dao.MediumBankInfoGroup, total int64, err error) {
sess := a.Db.Where("medium_bank_info.state>0").Desc("medium_bank_info.id").Limit(limit, (page-1)*limit)
if name != "" {
sess.And("medium_list.company_name like ?", "%"+name+"%")
sess.In("medium_list.medium_id", name)
}
if state != "" {
sess.And("medium_bank_info.state = ?", state)


+ 1
- 1
src/super/implement/medium_contact_info_db.go Visa fil

@@ -29,7 +29,7 @@ func (a MediumContactInfoDb) GetMediumContactInfoList(MediumId int) (medium *mod
func (a MediumContactInfoDb) FindMediumContactInfoList(uuid, name, state string, page, limit int) (list []dao.MediumContactInfoGroup, total int64, err error) {
sess := a.Db.Where("medium_contact_info.state>0").Desc("medium_contact_info.id").Limit(limit, (page-1)*limit)
if name != "" {
sess.And("medium_list.company_name like ?", "%"+name+"%")
sess.In("medium_list.medium_id", name)
}
if state != "" {
sess.And("medium_contact_info.state = ?", state)


+ 1
- 1
src/super/implement/medium_list_implement.go Visa fil

@@ -55,7 +55,7 @@ func (m MediumListDb) UpdateMediumList(medium *model.MediumList, columns ...stri
func (m MediumListDb) FindMediumList(uuid, name, state string, minState, page, limit int) (list []model.MediumList, total int64, err error) {
sess := m.Db.Desc("id").Limit(limit, (page-1)*limit)
if name != "" {
sess.And("company_name like ?", "%"+name+"%")
sess.In("medium_id", name)
}
if state != "" {
sess.And("state = ?", state)


Laddar…
Avbryt
Spara