作者 yangfu

Merge branch 'feature_sign_up' into test

... ... @@ -58,6 +58,8 @@ type SearchCooperationProjectQuery struct {
SearchCooperationProjectExtQueries []*SearchCooperationProjectExtQuery `cname:"额外的查询条件" json:"searchCooperationProjectExtQueries"`
// 按共创项目状态排序
SortByStatus int32 `cname:"按共创项目状态排序" json:"sortByStatus,omitempty"`
// 是否跳过获取共创模式
IsSkipFetchProjectModel bool `cname:"是否跳过获取共创模式" json:"isSkipFetchProjectModel,omitempty"`
}
func (searchCooperationProjectQuery *SearchCooperationProjectQuery) Valid(validation *validation.Validation) {
... ...
... ... @@ -157,10 +157,10 @@ func (dao *DividendsEstimateDao) CountDividendsEstimateDividendsAmount(queryOpti
query := tx.Model(&dividendsEstimateModels)
query.ColumnExpr("sum(dividends_amount) amount")
if companyId, ok := queryOptions["companyId"]; ok && companyId.(int64) != 0 {
query = query.Where(`dividends_estimate.company @> '{"companyId":"?"}'`, companyId)
query = query.Where(`dividends_estimate.company->>'companyId'='?'`, companyId)
}
if orgId, ok := queryOptions["orgId"]; ok && orgId.(int64) != 0 {
query = query.Where(`dividends_estimate.org @> '{"orgId":"?"}'`, orgId)
query = query.Where(`dividends_estimate.org->>'orgId'='?'`, orgId)
}
if userBaseId, ok := queryOptions["userBaseId"]; ok && userBaseId.(int64) != 0 {
query = query.Where(`dividends_user->>'userBaseId'='?'`, userBaseId)
... ...
... ... @@ -344,6 +344,14 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int
} else {
if count > 0 {
for _, cooperationProjectModel := range cooperationProjectModels {
if v, ok := queryOptions["isSkipFetchProjectModel"]; ok && v.(bool) {
if cooperationProject, err := transform.TransformToCooperationProjectDomainModelFromPgModels(cooperationProjectModel, &models.CooperationMode{}); err != nil {
return 0, cooperationProjects, err
} else {
cooperationProjects = append(cooperationProjects, cooperationProject)
}
continue
}
// 获取共创模式
var cooperationModeModels []*models.CooperationMode
cooperationModeQuery := tx.Model(&cooperationModeModels)
... ...