From 8c4c9709d02b1c82fa255572224ccc98a187e7e3 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Mon, 4 Nov 2024 14:34:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/super/dao/agent_bank_info_dao.go | 2 +- src/super/dao/agent_contact_info_dao.go | 2 +- src/super/dao/agent_list_dao.go | 2 +- src/super/implement/agent_bank_info_db.go | 6 +++++- src/super/implement/agent_contact_info_db.go | 6 +++++- src/super/implement/agent_list_implement.go | 6 +++++- 6 files changed, 18 insertions(+), 6 deletions(-) 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) }