作者 linmadan

修复排序bug

... ... @@ -586,11 +586,11 @@ func (taskService *TaskService) UpdateTask(updateTaskCommand *command.UpdateTask
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if count > 1 {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "问题资源已经被引用,创建任务失败")
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "问题资源已经被引用,编辑任务失败")
}
if count == 1 {
if tasks[0].TaskId != task.TaskId {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "问题资源已经被引用,创建任务失败")
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "问题资源已经被引用,编辑任务失败")
}
}
}
... ...
... ... @@ -195,7 +195,7 @@ func (repository *TaskRepository) Find(queryOptions map[string]interface{}) (int
} else if sortByReleaseTime, ok := queryOptions["sortByReleaseTime"]; ok && (sortByReleaseTime == "ASC" || sortByReleaseTime == "DESC") {
query = query.Order(fmt.Sprintf("task.release_time %s", sortByReleaseTime.(string)))
} else if sortByReceiveTime, ok := queryOptions["sortByReceiveTime"]; ok && (sortByReceiveTime == "ASC" || sortByReceiveTime == "DESC") {
query = query.Order(fmt.Sprintf("task.release_time %s", sortByReleaseTime.(string)))
query = query.Order(fmt.Sprintf("task.receive_time %s", sortByReceiveTime.(string)))
} else if sortByCompleteTime, ok := queryOptions["sortByCompleteTime"]; ok && (sortByCompleteTime == "ASC" || sortByCompleteTime == "DESC") {
query = query.Order(fmt.Sprintf("task.complete_time %s", sortByCompleteTime.(string)))
} else if sortByAcceptanceTime, ok := queryOptions["sortByAcceptanceTime"]; ok && (sortByAcceptanceTime == "ASC" || sortByAcceptanceTime == "DESC") {
... ...