...
|
...
|
@@ -136,7 +136,7 @@ func (repo *EvaluationProjectRepository) Find(queryOptions map[string]interface{ |
|
|
}
|
|
|
|
|
|
if v, ok := queryOptions["name"].(string); ok && len(v) > 0 {
|
|
|
query.Where("name = ?", v)
|
|
|
query.Where("name LIKE ?", v)
|
|
|
}
|
|
|
|
|
|
if v, ok := queryOptions["companyId"]; ok {
|
...
|
...
|
@@ -151,16 +151,13 @@ func (repo *EvaluationProjectRepository) Find(queryOptions map[string]interface{ |
|
|
query.Where("state = ?", v)
|
|
|
}
|
|
|
|
|
|
if v, ok := queryOptions["pmpIds"]; ok {
|
|
|
pmpIds := v.([]string)
|
|
|
if len(pmpIds) > 0 {
|
|
|
query.WhereGroup(func(query *pg.Query) (*pg.Query, error) {
|
|
|
for i := range pmpIds {
|
|
|
query.WhereOr("pmp_ids @> ?", pmpIds[i])
|
|
|
}
|
|
|
return query, nil
|
|
|
})
|
|
|
}
|
|
|
if v, ok := queryOptions["pmpIds"].([]string); ok && len(v) > 0 {
|
|
|
query.WhereGroup(func(query *pg.Query) (*pg.Query, error) {
|
|
|
for i := range v {
|
|
|
query.WhereOr("pmp_ids @> ?", `"`+v[i]+`"`)
|
|
|
}
|
|
|
return query, nil
|
|
|
})
|
|
|
}
|
|
|
|
|
|
if v, ok := queryOptions["limit"].(int64); ok {
|
...
|
...
|
|