作者 linmadan

修复bug

@@ -531,7 +531,7 @@ func (taskService *TaskService) SearchOffTaskRecord(searchOffTaskRecordCommand * @@ -531,7 +531,7 @@ func (taskService *TaskService) SearchOffTaskRecord(searchOffTaskRecordCommand *
531 }); err != nil { 531 }); err != nil {
532 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 532 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
533 } else { 533 } else {
534 - var offTaskRecordDtos []*dto.OffTaskRecordDto 534 + offTaskRecordDtos := make([]*dto.OffTaskRecordDto, 0)
535 for _, offTaskRecord := range offTaskRecords { 535 for _, offTaskRecord := range offTaskRecords {
536 for _, task := range tasks { 536 for _, task := range tasks {
537 if offTaskRecord.Task.TaskId == task.TaskId { 537 if offTaskRecord.Task.TaskId == task.TaskId {
@@ -701,7 +701,7 @@ func (taskService *TaskService) SearchRejectTaskRecord(searchRejectTaskRecordCom @@ -701,7 +701,7 @@ func (taskService *TaskService) SearchRejectTaskRecord(searchRejectTaskRecordCom
701 }); err != nil { 701 }); err != nil {
702 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 702 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
703 } else { 703 } else {
704 - var rejectTaskRecordDtos []*dto.RejectTaskRecordDto 704 + rejectTaskRecordDtos := make([]*dto.RejectTaskRecordDto, 0)
705 for _, rejectTaskRecord := range rejectTaskRecords { 705 for _, rejectTaskRecord := range rejectTaskRecords {
706 for _, task := range tasks { 706 for _, task := range tasks {
707 if rejectTaskRecord.Task.TaskId == task.TaskId { 707 if rejectTaskRecord.Task.TaskId == task.TaskId {
@@ -719,7 +719,7 @@ func (taskService *TaskService) SearchRejectTaskRecord(searchRejectTaskRecordCom @@ -719,7 +719,7 @@ func (taskService *TaskService) SearchRejectTaskRecord(searchRejectTaskRecordCom
719 } 719 }
720 return map[string]interface{}{ 720 return map[string]interface{}{
721 "count": count, 721 "count": count,
722 - "offTaskRecords": rejectTaskRecordDtos, 722 + "rejectTaskRecords": rejectTaskRecordDtos,
723 }, nil 723 }, nil
724 } 724 }
725 } 725 }
@@ -118,7 +118,7 @@ func (repository *TaskRepository) Find(queryOptions map[string]interface{}) (int @@ -118,7 +118,7 @@ func (repository *TaskRepository) Find(queryOptions map[string]interface{}) (int
118 if projectBelongs, ok := queryOptions["projectBelongs"]; ok && len(projectBelongs.([]int)) != 0 { 118 if projectBelongs, ok := queryOptions["projectBelongs"]; ok && len(projectBelongs.([]int)) != 0 {
119 query = query.WhereGroup(func(q *orm.Query) (*orm.Query, error) { 119 query = query.WhereGroup(func(q *orm.Query) (*orm.Query, error) {
120 for _, value := range projectBelongs.([]int) { 120 for _, value := range projectBelongs.([]int) {
121 - q = q.WhereOr("task.project_belongs @> ?", pg.Array([]int{value})) 121 + q = q.WhereOr("task.project_belong = ?", value)
122 } 122 }
123 return q, nil 123 return q, nil
124 }) 124 })
@@ -126,7 +126,7 @@ func (repository *TaskRepository) Find(queryOptions map[string]interface{}) (int @@ -126,7 +126,7 @@ func (repository *TaskRepository) Find(queryOptions map[string]interface{}) (int
126 if taskNatures, ok := queryOptions["taskNatures"]; ok && len(taskNatures.([]int)) != 0 { 126 if taskNatures, ok := queryOptions["taskNatures"]; ok && len(taskNatures.([]int)) != 0 {
127 query = query.WhereGroup(func(q *orm.Query) (*orm.Query, error) { 127 query = query.WhereGroup(func(q *orm.Query) (*orm.Query, error) {
128 for _, value := range taskNatures.([]int) { 128 for _, value := range taskNatures.([]int) {
129 - q = q.WhereOr("task.task_natures @> ?", pg.Array([]int{value})) 129 + q = q.WhereOr("task.task_nature = ?", value)
130 } 130 }
131 return q, nil 131 return q, nil
132 }) 132 })