diff --git a/src/super/dao/agent_bank_info_dao.go b/src/super/dao/agent_bank_info_dao.go index fd21467..f15b913 100644 --- a/src/super/dao/agent_bank_info_dao.go +++ b/src/super/dao/agent_bank_info_dao.go @@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" type AgentBankInfoDao interface { GetAgentBankInfoList(agentId int) (medium *model.AgentBankInfo, err error) - FindAgentBankInfoList(uuid, name, state string, page, limit int) (list []AgentBankInfoGroup, total int64, err error) + FindAgentBankInfoList(uuid, name, agentId, state string, page, limit int) (list []AgentBankInfoGroup, total int64, err error) } type AgentBankInfoGroup struct { model.AgentBankInfo `xorm:"extends"` diff --git a/src/super/dao/agent_contact_info_dao.go b/src/super/dao/agent_contact_info_dao.go index ea431a6..f3e918f 100644 --- a/src/super/dao/agent_contact_info_dao.go +++ b/src/super/dao/agent_contact_info_dao.go @@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" type AgentContactInfoDao interface { GetAgentContactInfoList(agentId int) (medium *model.AgentContactInfo, err error) - FindAgentContactInfoList(uuid, name, state string, page, limit int) (list []AgentContactInfoGroup, total int64, err error) + FindAgentContactInfoList(uuid, name, agentId, state string, page, limit int) (list []AgentContactInfoGroup, total int64, err error) } type AgentContactInfoGroup struct { model.AgentContactInfo `xorm:"extends"` diff --git a/src/super/dao/agent_list_dao.go b/src/super/dao/agent_list_dao.go index 529f216..84988fe 100644 --- a/src/super/dao/agent_list_dao.go +++ b/src/super/dao/agent_list_dao.go @@ -10,6 +10,6 @@ type AgentListDao interface { GetAgentListBySession(session *xorm.Session, agentId int) (agent *model.AgentList, err error) AgentListInsert(m *model.AgentList) (int64, error) UpdateAgentList(m *model.AgentList, columns ...string) (int64, error) - FindAgentList(uuid, name, state string, minState, page, limit int) (list []model.AgentList, total int64, err error) + FindAgentList(uuid, name, agentId, state string, minState, page, limit int) (list []model.AgentList, total int64, err error) FindAgentListBySettleType(uuid, agentId, settleType string, page, limit int) (list []model.AgentList, total int64, err error) } diff --git a/src/super/implement/agent_bank_info_db.go b/src/super/implement/agent_bank_info_db.go index 3c7fd98..dc10f85 100644 --- a/src/super/implement/agent_bank_info_db.go +++ b/src/super/implement/agent_bank_info_db.go @@ -4,6 +4,7 @@ import ( "code.fnuoos.com/zhimeng/model.git/src/super/dao" "code.fnuoos.com/zhimeng/model.git/src/super/model" zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" + "strings" "xorm.io/xorm" ) @@ -26,8 +27,11 @@ func (a AgentBankInfoDb) GetAgentBankInfoList(agentId int) (medium *model.AgentB } return medium, nil } -func (a AgentBankInfoDb) FindAgentBankInfoList(uuid, name, state string, page, limit int) (list []dao.AgentBankInfoGroup, total int64, err error) { +func (a AgentBankInfoDb) FindAgentBankInfoList(uuid, name, agentId, state string, page, limit int) (list []dao.AgentBankInfoGroup, total int64, err error) { sess := a.Db.Where("agent_bank_info.state>0").Desc("agent_bank_info.id").Limit(limit, (page-1)*limit) + if agentId != "" { + sess.In("agent_list.agent_id", strings.Split(agentId, ",")) + } if name != "" { sess.And("agent_list.company_name like ?", "%"+name+"%") } diff --git a/src/super/implement/agent_contact_info_db.go b/src/super/implement/agent_contact_info_db.go index caba0b3..15d99e8 100644 --- a/src/super/implement/agent_contact_info_db.go +++ b/src/super/implement/agent_contact_info_db.go @@ -4,6 +4,7 @@ import ( "code.fnuoos.com/zhimeng/model.git/src/super/dao" "code.fnuoos.com/zhimeng/model.git/src/super/model" zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" + "strings" "xorm.io/xorm" ) @@ -26,8 +27,11 @@ func (a AgentContactInfoDb) GetAgentContactInfoList(agentId int) (medium *model. } return medium, nil } -func (a AgentContactInfoDb) FindAgentContactInfoList(uuid, name, state string, page, limit int) (list []dao.AgentContactInfoGroup, total int64, err error) { +func (a AgentContactInfoDb) FindAgentContactInfoList(uuid, name, agentId, state string, page, limit int) (list []dao.AgentContactInfoGroup, total int64, err error) { sess := a.Db.Where("agent_contact_info.state>0").Desc("agent_contact_info.id").Limit(limit, (page-1)*limit) + if agentId != "" { + sess.In("agent_list.agent_id", strings.Split(agentId, ",")) + } if name != "" { sess.And("agent_list.company_name like ?", "%"+name+"%") } diff --git a/src/super/implement/agent_list_implement.go b/src/super/implement/agent_list_implement.go index 05969f2..5ea68de 100644 --- a/src/super/implement/agent_list_implement.go +++ b/src/super/implement/agent_list_implement.go @@ -52,11 +52,15 @@ func (a AgentListDb) UpdateAgentList(m *model.AgentList, columns ...string) (int } return affected, nil } -func (a AgentListDb) FindAgentList(uuid, name, state string, minState, page, limit int) (list []model.AgentList, total int64, err error) { +func (a AgentListDb) FindAgentList(uuid, name, agentId, state string, minState, page, limit int) (list []model.AgentList, total int64, err error) { sess := a.Db.Desc("id").Limit(limit, (page-1)*limit) + if agentId != "" { + sess.In("agent_id", strings.Split(agentId, ",")) + } if name != "" { sess.And("company_name like ?", "%"+name+"%") } + if state != "" { sess.And("state = ?", state) }