@@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
type AgentBankInfoDao interface { | type AgentBankInfoDao interface { | ||||
GetAgentBankInfoList(agentId int) (medium *model.AgentBankInfo, err error) | 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 { | type AgentBankInfoGroup struct { | ||||
model.AgentBankInfo `xorm:"extends"` | model.AgentBankInfo `xorm:"extends"` | ||||
@@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
type AgentContactInfoDao interface { | type AgentContactInfoDao interface { | ||||
GetAgentContactInfoList(agentId int) (medium *model.AgentContactInfo, err error) | 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 { | type AgentContactInfoGroup struct { | ||||
model.AgentContactInfo `xorm:"extends"` | model.AgentContactInfo `xorm:"extends"` | ||||
@@ -10,6 +10,6 @@ type AgentListDao interface { | |||||
GetAgentListBySession(session *xorm.Session, agentId int) (agent *model.AgentList, err error) | GetAgentListBySession(session *xorm.Session, agentId int) (agent *model.AgentList, err error) | ||||
AgentListInsert(m *model.AgentList) (int64, error) | AgentListInsert(m *model.AgentList) (int64, error) | ||||
UpdateAgentList(m *model.AgentList, columns ...string) (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) | FindAgentListBySettleType(uuid, agentId, settleType string, page, limit int) (list []model.AgentList, total int64, err error) | ||||
} | } |
@@ -4,6 +4,7 @@ import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/dao" | "code.fnuoos.com/zhimeng/model.git/src/super/dao" | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | "code.fnuoos.com/zhimeng/model.git/src/super/model" | ||||
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" | zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" | ||||
"strings" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -26,8 +27,11 @@ func (a AgentBankInfoDb) GetAgentBankInfoList(agentId int) (medium *model.AgentB | |||||
} | } | ||||
return medium, nil | 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) | 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 != "" { | if name != "" { | ||||
sess.And("agent_list.company_name like ?", "%"+name+"%") | sess.And("agent_list.company_name like ?", "%"+name+"%") | ||||
} | } | ||||
@@ -4,6 +4,7 @@ import ( | |||||
"code.fnuoos.com/zhimeng/model.git/src/super/dao" | "code.fnuoos.com/zhimeng/model.git/src/super/dao" | ||||
"code.fnuoos.com/zhimeng/model.git/src/super/model" | "code.fnuoos.com/zhimeng/model.git/src/super/model" | ||||
zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" | zhios_order_relate_logx "code.fnuoos.com/zhimeng/model.git/utils/logx" | ||||
"strings" | |||||
"xorm.io/xorm" | "xorm.io/xorm" | ||||
) | ) | ||||
@@ -26,8 +27,11 @@ func (a AgentContactInfoDb) GetAgentContactInfoList(agentId int) (medium *model. | |||||
} | } | ||||
return medium, nil | 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) | 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 != "" { | if name != "" { | ||||
sess.And("agent_list.company_name like ?", "%"+name+"%") | sess.And("agent_list.company_name like ?", "%"+name+"%") | ||||
} | } | ||||
@@ -52,11 +52,15 @@ func (a AgentListDb) UpdateAgentList(m *model.AgentList, columns ...string) (int | |||||
} | } | ||||
return affected, nil | 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) | sess := a.Db.Desc("id").Limit(limit, (page-1)*limit) | ||||
if agentId != "" { | |||||
sess.In("agent_id", strings.Split(agentId, ",")) | |||||
} | |||||
if name != "" { | if name != "" { | ||||
sess.And("company_name like ?", "%"+name+"%") | sess.And("company_name like ?", "%"+name+"%") | ||||
} | } | ||||
if state != "" { | if state != "" { | ||||
sess.And("state = ?", state) | sess.And("state = ?", state) | ||||
} | } | ||||