作者 唐旭辉

bug 修复

... ... @@ -176,8 +176,14 @@ func (repository PartnerInfoRepository) CountAll(queryOption domain.PartnerFindQ
if queryOption.RegionInfo != nil {
query = query.Where("region_info::jsonb->>'regionName' like ?", "%"+queryOption.RegionInfo.RegionName+"%")
}
//合伙人类型
if len(queryOption.PartnerCategory) > 0 {
query = query.WhereIn("partner_category in(?)", queryOption.PartnerCategory)
query = query.WhereGroup(func(q *orm.Query) (*orm.Query, error) {
for _, value := range queryOption.PartnerCategory {
q = q.WhereOr(`partner_category_infos@> '[{"id":?}]'`, value)
}
return q, nil
})
}
if queryOption.CompanyId > 0 {
query = query.Where("company_id=?", queryOption.CompanyId)
... ...