作者 linmadan

修复bug

... ... @@ -531,7 +531,7 @@ func (taskService *TaskService) SearchOffTaskRecord(searchOffTaskRecordCommand *
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
var offTaskRecordDtos []*dto.OffTaskRecordDto
offTaskRecordDtos := make([]*dto.OffTaskRecordDto, 0)
for _, offTaskRecord := range offTaskRecords {
for _, task := range tasks {
if offTaskRecord.Task.TaskId == task.TaskId {
... ... @@ -701,7 +701,7 @@ func (taskService *TaskService) SearchRejectTaskRecord(searchRejectTaskRecordCom
}); err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
var rejectTaskRecordDtos []*dto.RejectTaskRecordDto
rejectTaskRecordDtos := make([]*dto.RejectTaskRecordDto, 0)
for _, rejectTaskRecord := range rejectTaskRecords {
for _, task := range tasks {
if rejectTaskRecord.Task.TaskId == task.TaskId {
... ... @@ -719,7 +719,7 @@ func (taskService *TaskService) SearchRejectTaskRecord(searchRejectTaskRecordCom
}
return map[string]interface{}{
"count": count,
"offTaskRecords": rejectTaskRecordDtos,
"rejectTaskRecords": rejectTaskRecordDtos,
}, nil
}
}
... ...
... ... @@ -118,7 +118,7 @@ func (repository *TaskRepository) Find(queryOptions map[string]interface{}) (int
if projectBelongs, ok := queryOptions["projectBelongs"]; ok && len(projectBelongs.([]int)) != 0 {
query = query.WhereGroup(func(q *orm.Query) (*orm.Query, error) {
for _, value := range projectBelongs.([]int) {
q = q.WhereOr("task.project_belongs @> ?", pg.Array([]int{value}))
q = q.WhereOr("task.project_belong = ?", value)
}
return q, nil
})
... ... @@ -126,7 +126,7 @@ func (repository *TaskRepository) Find(queryOptions map[string]interface{}) (int
if taskNatures, ok := queryOptions["taskNatures"]; ok && len(taskNatures.([]int)) != 0 {
query = query.WhereGroup(func(q *orm.Query) (*orm.Query, error) {
for _, value := range taskNatures.([]int) {
q = q.WhereOr("task.task_natures @> ?", pg.Array([]int{value}))
q = q.WhereOr("task.task_nature = ?", value)
}
return q, nil
})
... ...