diff --git a/models/action.go b/models/action.go index b5b3381e3..ca2aad8d8 100755 --- a/models/action.go +++ b/models/action.go @@ -260,6 +260,7 @@ func (a *Action) ToShow() *ActionShow { if a.Cloudbrain != nil { c := &CloudbrainShow4Action{ ID: a.Cloudbrain.ID, + JobId: a.Cloudbrain.JobID, Type: a.Cloudbrain.Type, JobType: a.Cloudbrain.JobType, DisplayJobName: a.Cloudbrain.DisplayJobName, diff --git a/models/cloudbrain.go b/models/cloudbrain.go index 917de1ba0..e2c00cf92 100755 --- a/models/cloudbrain.go +++ b/models/cloudbrain.go @@ -194,6 +194,7 @@ type CloudbrainShow struct { type CloudbrainShow4Action struct { ID int64 + JobId string Type int JobType string DisplayJobName string diff --git a/models/task_config.go b/models/task_config.go index 221ef9c58..fd8648296 100644 --- a/models/task_config.go +++ b/models/task_config.go @@ -29,7 +29,9 @@ type TaskConfigWithLimit struct { AwardType string AwardAmount int64 Creator string + IsDeleted bool CreatedUnix timeutil.TimeStamp + DeleteAt timeutil.TimeStamp Limiters []*LimitConfigVO } type BatchLimitConfigVO struct { @@ -64,8 +66,11 @@ func GetTaskConfigList() ([]*TaskConfig, error) { return r, nil } func GetTaskConfigPageWithDeleted(opt ListOptions) ([]*TaskConfig, error) { + if opt.Page <= 0 { + opt.Page = 1 + } r := make([]*TaskConfig, 0) - err := x.Unscoped().Limit(opt.PageSize, (opt.Page-1)*opt.PageSize).OrderBy("deleted_at asc,id desc").Find(&r) + err := x.Unscoped().Limit(opt.PageSize, (opt.Page-1)*opt.PageSize).OrderBy("deleted_at desc,id desc").Find(&r) if err != nil { return nil, err } diff --git a/services/task/task_config.go b/services/task/task_config.go index cc4f3c934..6aefc8ba1 100644 --- a/services/task/task_config.go +++ b/services/task/task_config.go @@ -87,6 +87,8 @@ func GetTaskConfigWithLimitList(opt models.ListOptions) ([]*models.TaskConfigWit AwardAmount: li.AwardAmount, Creator: li.CreatorName, CreatedUnix: li.CreatedUnix, + IsDeleted: li.DeletedAt > 0, + DeleteAt: li.DeletedAt, } lv := make([]*models.LimitConfigVO, 0) for j := 0; j < len(l); j++ {