作者 tangxvhui

里程碑数据查询错误

... ... @@ -596,6 +596,11 @@ func (srv TaskService) ListTask(param *command.ListTaskCommand) (map[string]inte
Name: val.Name,
StatusDescription: val.StatusDescription(),
SortBy: val.SortBy,
PlanCompletedAt: time.Unix(int64(val.PlanCompletedAt), 0).Local().Format("2006-01-02"),
RealCompletedAt: "",
}
if val.RealCompletedAt > 0 {
stage.RealCompletedAt = time.Unix(int64(val.RealCompletedAt), 0).Local().Format("2006-01-02")
}
switch val.SortBy {
case 1:
... ... @@ -887,10 +892,9 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction
if err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务数据"+err.Error())
}
if !(len(val.AssistContent) == 0 || val.AssistContent == "无") {
taskData.Anomaly = 0
}
// if !(len(val.AssistContent) == 0 || val.AssistContent == "无") {
// taskData.Anomaly = 0
// }
taskList = append(taskList, taskData)
_, stageList, err := taskStageRepo.Find(map[string]interface{}{"ids": []int{val.TaskStageCheck.Id}})
if err != nil {
... ...
... ... @@ -8,9 +8,9 @@ import (
func TestGenerateToken(t *testing.T) {
ut := UserAuth{
CompanyId: 233,
UserId: 3240357405361920,
Phone: "13459147023",
CompanyId: 8,
UserId: 3438641393081088,
Phone: "17711111111",
PlatformId: 28,
AdminType: 1,
}
... ...
... ... @@ -102,8 +102,7 @@ func (repo *TaskStageRepository) Find(queryOptions map[string]interface{}) (int,
tx := repo.transactionContext.PgTx
var m []*models.TaskStage
query := tx.Model(&m).
Where("deleted_at isnull").
Limit(20)
Where("deleted_at isnull")
if val, ok := queryOptions["taskId"]; ok {
query.Where("task_stage.task_id = ?", val)
... ...