...
|
...
|
@@ -232,6 +232,15 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int |
|
|
var cooperationProjectModels []*models.CooperationProject
|
|
|
cooperationProjects := make([]*domain.CooperationProject, 0)
|
|
|
query := sqlbuilder.BuildQuery(tx.Model(&cooperationProjectModels), queryOptions)
|
|
|
if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 {
|
|
|
query.Where("company->>'companyId' = '?'", companyId)
|
|
|
}
|
|
|
if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 {
|
|
|
query.Where("org->>'orgId' = '?'", orgId)
|
|
|
}
|
|
|
if orgIds, ok := queryOptions["orgIds"]; ok && len(orgIds.([]int64)) > 0 {
|
|
|
query.Where("org->>'orgId' in (?)", pg.In(orgIds))
|
|
|
}
|
|
|
if v, ok := queryOptions["status"]; ok && v.(int32) > 0 {
|
|
|
query.Where("status =? ", v)
|
|
|
}
|
...
|
...
|
|