@@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
type MediumBankInfoDao interface { | type MediumBankInfoDao interface { | ||||
GetMediumBankInfoList(MediumId int) (medium *model.MediumBankInfo, err error) | 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 { | type MediumBankInfoGroup struct { | ||||
model.MediumBankInfo `xorm:"extends"` | model.MediumBankInfo `xorm:"extends"` | ||||
@@ -4,7 +4,7 @@ import "code.fnuoos.com/zhimeng/model.git/src/super/model" | |||||
type MediumContactInfoDao interface { | type MediumContactInfoDao interface { | ||||
GetMediumContactInfoList(MediumId int) (medium *model.MediumContactInfo, err error) | 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 { | type MediumContactInfoGroup struct { | ||||
model.MediumContactInfo `xorm:"extends"` | model.MediumContactInfo `xorm:"extends"` | ||||
@@ -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,10 +27,13 @@ func (a MediumBankInfoDb) GetMediumBankInfoList(MediumId int) (medium *model.Med | |||||
} | } | ||||
return medium, nil | 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) | 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 != "" { | if name != "" { | ||||
sess.In("medium_list.medium_id", name) | |||||
sess.And("medium_list.company_name like ?", "%"+name+"%") | |||||
} | } | ||||
if state != "" { | if state != "" { | ||||
sess.And("medium_bank_info.state = ?", state) | sess.And("medium_bank_info.state = ?", state) | ||||
@@ -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,10 +27,13 @@ func (a MediumContactInfoDb) GetMediumContactInfoList(MediumId int) (medium *mod | |||||
} | } | ||||
return medium, nil | 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) | 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 != "" { | if name != "" { | ||||
sess.In("medium_list.medium_id", name) | |||||
sess.And("medium_list.company_name like ?", "%"+name+"%") | |||||
} | } | ||||
if state != "" { | if state != "" { | ||||
sess.And("medium_contact_info.state = ?", state) | sess.And("medium_contact_info.state = ?", state) | ||||