Merge branch 'feature_sign_up' into test
正在显示
3 个修改的文件
包含
12 行增加
和
2 行删除
@@ -58,6 +58,8 @@ type SearchCooperationProjectQuery struct { | @@ -58,6 +58,8 @@ type SearchCooperationProjectQuery struct { | ||
58 | SearchCooperationProjectExtQueries []*SearchCooperationProjectExtQuery `cname:"额外的查询条件" json:"searchCooperationProjectExtQueries"` | 58 | SearchCooperationProjectExtQueries []*SearchCooperationProjectExtQuery `cname:"额外的查询条件" json:"searchCooperationProjectExtQueries"` |
59 | // 按共创项目状态排序 | 59 | // 按共创项目状态排序 |
60 | SortByStatus int32 `cname:"按共创项目状态排序" json:"sortByStatus,omitempty"` | 60 | SortByStatus int32 `cname:"按共创项目状态排序" json:"sortByStatus,omitempty"` |
61 | + // 是否跳过获取共创模式 | ||
62 | + IsSkipFetchProjectModel bool `cname:"是否跳过获取共创模式" json:"isSkipFetchProjectModel,omitempty"` | ||
61 | } | 63 | } |
62 | 64 | ||
63 | func (searchCooperationProjectQuery *SearchCooperationProjectQuery) Valid(validation *validation.Validation) { | 65 | func (searchCooperationProjectQuery *SearchCooperationProjectQuery) Valid(validation *validation.Validation) { |
@@ -157,10 +157,10 @@ func (dao *DividendsEstimateDao) CountDividendsEstimateDividendsAmount(queryOpti | @@ -157,10 +157,10 @@ func (dao *DividendsEstimateDao) CountDividendsEstimateDividendsAmount(queryOpti | ||
157 | query := tx.Model(÷ndsEstimateModels) | 157 | query := tx.Model(÷ndsEstimateModels) |
158 | query.ColumnExpr("sum(dividends_amount) amount") | 158 | query.ColumnExpr("sum(dividends_amount) amount") |
159 | if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 { | 159 | if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 { |
160 | - query = query.Where(`dividends_estimate.company @> '{"companyId":"?"}'`, companyId) | 160 | + query = query.Where(`dividends_estimate.company->>'companyId'='?'`, companyId) |
161 | } | 161 | } |
162 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { | 162 | if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 { |
163 | - query = query.Where(`dividends_estimate.org @> '{"orgId":"?"}'`, orgId) | 163 | + query = query.Where(`dividends_estimate.org->>'orgId'='?'`, orgId) |
164 | } | 164 | } |
165 | if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 { | 165 | if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 { |
166 | query = query.Where(`dividends_user->>'userBaseId'='?'`, userBaseId) | 166 | query = query.Where(`dividends_user->>'userBaseId'='?'`, userBaseId) |
@@ -344,6 +344,14 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int | @@ -344,6 +344,14 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int | ||
344 | } else { | 344 | } else { |
345 | if count > 0 { | 345 | if count > 0 { |
346 | for _, cooperationProjectModel := range cooperationProjectModels { | 346 | for _, cooperationProjectModel := range cooperationProjectModels { |
347 | + if v, ok := queryOptions["isSkipFetchProjectModel"]; ok && v.(bool) { | ||
348 | + if cooperationProject, err := transform.TransformToCooperationProjectDomainModelFromPgModels(cooperationProjectModel, &models.CooperationMode{}); err != nil { | ||
349 | + return 0, cooperationProjects, err | ||
350 | + } else { | ||
351 | + cooperationProjects = append(cooperationProjects, cooperationProject) | ||
352 | + } | ||
353 | + continue | ||
354 | + } | ||
347 | // 获取共创模式 | 355 | // 获取共创模式 |
348 | var cooperationModeModels []*models.CooperationMode | 356 | var cooperationModeModels []*models.CooperationMode |
349 | cooperationModeQuery := tx.Model(&cooperationModeModels) | 357 | cooperationModeQuery := tx.Model(&cooperationModeModels) |
-
请 注册 或 登录 后发表评论