From d86cf0dcee0ecd2036fca4e44426316399ac75b9 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Fri, 25 Oct 2024 09:41:13 +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/medium_bank_info_dao.go | 2 +- src/super/dao/medium_contact_info_dao.go | 2 +- src/super/implement/medium_bank_info_db.go | 8 ++++++-- src/super/implement/medium_contact_info_db.go | 8 ++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/super/dao/medium_bank_info_dao.go b/src/super/dao/medium_bank_info_dao.go index 4f7fd8a..b2bb7da 100644 --- a/src/super/dao/medium_bank_info_dao.go +++ b/src/super/dao/medium_bank_info_dao.go @@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" type MediumBankInfoDao interface { GetMediumBankInfoList(MediumId int) (medium *model.MediumBankInfo, err error) - FindMediumBankInfoList(uuid, name, state string, page, limit int) (list []MediumBankInfoGroup, total int64, err error) + FindMediumBankInfoList(uuid, name, mediumId, state string, page, limit int) (list []MediumBankInfoGroup, total int64, err error) } type MediumBankInfoGroup struct { model.MediumBankInfo `xorm:"extends"` diff --git a/src/super/dao/medium_contact_info_dao.go b/src/super/dao/medium_contact_info_dao.go index afa9613..dcd5630 100644 --- a/src/super/dao/medium_contact_info_dao.go +++ b/src/super/dao/medium_contact_info_dao.go @@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" type MediumContactInfoDao interface { GetMediumContactInfoList(MediumId int) (medium *model.MediumContactInfo, err error) - FindMediumContactInfoList(uuid, name, state string, page, limit int) (list []MediumContactInfoGroup, total int64, err error) + FindMediumContactInfoList(uuid, name, mediumId, state string, page, limit int) (list []MediumContactInfoGroup, total int64, err error) } type MediumContactInfoGroup struct { model.MediumContactInfo `xorm:"extends"` diff --git a/src/super/implement/medium_bank_info_db.go b/src/super/implement/medium_bank_info_db.go index caa7ad3..18e19fa 100644 --- a/src/super/implement/medium_bank_info_db.go +++ b/src/super/implement/medium_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,10 +27,13 @@ func (a MediumBankInfoDb) GetMediumBankInfoList(MediumId int) (medium *model.Med } return medium, nil } -func (a MediumBankInfoDb) FindMediumBankInfoList(uuid, name, state string, page, limit int) (list []dao.MediumBankInfoGroup, total int64, err error) { +func (a MediumBankInfoDb) FindMediumBankInfoList(uuid, name, mediumId, 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 mediumId != "" { + sess.In("medium_list.medium_id", strings.Split(mediumId, ",")) + } if name != "" { - sess.In("medium_list.medium_id", name) + sess.And("medium_list.company_name like ?", "%"+name+"%") } if state != "" { sess.And("medium_bank_info.state = ?", state) diff --git a/src/super/implement/medium_contact_info_db.go b/src/super/implement/medium_contact_info_db.go index 5fd6ed4..3041f63 100644 --- a/src/super/implement/medium_contact_info_db.go +++ b/src/super/implement/medium_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,10 +27,13 @@ func (a MediumContactInfoDb) GetMediumContactInfoList(MediumId int) (medium *mod } return medium, nil } -func (a MediumContactInfoDb) FindMediumContactInfoList(uuid, name, state string, page, limit int) (list []dao.MediumContactInfoGroup, total int64, err error) { +func (a MediumContactInfoDb) FindMediumContactInfoList(uuid, name, mediumId, 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 mediumId != "" { + sess.In("medium_list.medium_id", strings.Split(mediumId, ",")) + } if name != "" { - sess.In("medium_list.medium_id", name) + sess.And("medium_list.company_name like ?", "%"+name+"%") } if state != "" { sess.And("medium_contact_info.state = ?", state)