|
|
@@ -26,7 +26,7 @@ func (a MediumContactInfoDb) GetMediumContactInfoList(MediumId int) (medium *mod |
|
|
|
} |
|
|
|
return medium, nil |
|
|
|
} |
|
|
|
func (a MediumContactInfoDb) FindMediumContactInfoList(name, state string, page, limit int) (list []dao.MediumContactInfoGroup, total int64, err error) { |
|
|
|
func (a MediumContactInfoDb) FindMediumContactInfoList(uuid, name, 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 name != "" { |
|
|
|
sess.And("medium_list.company_name like ?", "%"+name+"%") |
|
|
@@ -34,6 +34,9 @@ func (a MediumContactInfoDb) FindMediumContactInfoList(name, state string, page, |
|
|
|
if state != "" { |
|
|
|
sess.And("medium_contact_info.state = ?", state) |
|
|
|
} |
|
|
|
if uuid != "" { |
|
|
|
sess.And("medium_contact_info.uuid = ?", uuid) |
|
|
|
} |
|
|
|
sess.Join("LEFT", "medium_list", "medium_list.medium_id = medium_contact_info.medium_id") |
|
|
|
total, err = sess.FindAndCount(&list) |
|
|
|
if err != nil { |
|
|
|