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)