Browse Source

#2225

update
tags/v1.22.9.2^2
chenyifan01 3 years ago
parent
commit
747b071003
4 changed files with 10 additions and 1 deletions
  1. +1
    -0
      models/action.go
  2. +1
    -0
      models/cloudbrain.go
  3. +6
    -1
      models/task_config.go
  4. +2
    -0
      services/task/task_config.go

+ 1
- 0
models/action.go View File

@@ -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,


+ 1
- 0
models/cloudbrain.go View File

@@ -194,6 +194,7 @@ type CloudbrainShow struct {

type CloudbrainShow4Action struct {
ID int64
JobId string
Type int
JobType string
DisplayJobName string


+ 6
- 1
models/task_config.go View File

@@ -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
}


+ 2
- 0
services/task/task_config.go View File

@@ -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++ {


Loading…
Cancel
Save