作者 陈志颖

fix:共创项目编号查询

@@ -34,7 +34,6 @@ type SearchCooperationProjectQuery struct { @@ -34,7 +34,6 @@ type SearchCooperationProjectQuery struct {
34 } 34 }
35 35
36 func (searchCooperationProjectQuery *SearchCooperationProjectQuery) Valid(validation *validation.Validation) { 36 func (searchCooperationProjectQuery *SearchCooperationProjectQuery) Valid(validation *validation.Validation) {
37 - //validation.SetError("CustomValid", "未实现的自定义认证")  
38 } 37 }
39 38
40 func (searchCooperationProjectQuery *SearchCooperationProjectQuery) ValidateQuery() error { 39 func (searchCooperationProjectQuery *SearchCooperationProjectQuery) ValidateQuery() error {
@@ -269,6 +269,7 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int @@ -269,6 +269,7 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int
269 if count, err := query.SelectAndCount(); err != nil { 269 if count, err := query.SelectAndCount(); err != nil {
270 return 0, cooperationProjects, err 270 return 0, cooperationProjects, err
271 } else { 271 } else {
  272 + if count > 0 {
272 for _, cooperationProjectModel := range cooperationProjectModels { 273 for _, cooperationProjectModel := range cooperationProjectModels {
273 // 获取共创模式 274 // 获取共创模式
274 cooperationModeModel := new(models.CooperationMode) 275 cooperationModeModel := new(models.CooperationMode)
@@ -282,6 +283,7 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int @@ -282,6 +283,7 @@ func (repository *CooperationProjectRepository) Find(queryOptions map[string]int
282 cooperationProjects = append(cooperationProjects, cooperationProject) 283 cooperationProjects = append(cooperationProjects, cooperationProject)
283 } 284 }
284 } 285 }
  286 + }
285 return int64(count), cooperationProjects, nil 287 return int64(count), cooperationProjects, nil
286 } 288 }
287 } 289 }