|
@@ -3,6 +3,8 @@ package db
|
|
import (
|
|
import (
|
|
"context"
|
|
"context"
|
|
"fmt"
|
|
"fmt"
|
|
|
|
+ "github.com/caixw/lib.go/conv"
|
|
|
|
+ "github.com/sirupsen/logrus"
|
|
"reflect"
|
|
"reflect"
|
|
"strings"
|
|
"strings"
|
|
"time"
|
|
"time"
|
|
@@ -11,9 +13,6 @@ import (
|
|
"youngee_m_api/model/http_model"
|
|
"youngee_m_api/model/http_model"
|
|
"youngee_m_api/pack"
|
|
"youngee_m_api/pack"
|
|
"youngee_m_api/util"
|
|
"youngee_m_api/util"
|
|
-
|
|
|
|
- "github.com/caixw/lib.go/conv"
|
|
|
|
- "github.com/sirupsen/logrus"
|
|
|
|
)
|
|
)
|
|
|
|
|
|
// GetTaskDataList 查询上传链接的task list
|
|
// GetTaskDataList 查询上传链接的task list
|
|
@@ -42,8 +41,17 @@ func GetTaskDataList(ctx context.Context, projectID string, pageSize, pageNum in
|
|
if tag == "platform_nickname" {
|
|
if tag == "platform_nickname" {
|
|
platform_nickname = fmt.Sprintf("%v", value.Interface())
|
|
platform_nickname = fmt.Sprintf("%v", value.Interface())
|
|
continue
|
|
continue
|
|
- } else if tag == "project_id" || tag == "strategy_id" {
|
|
|
|
|
|
+ } else if tag == "project_id" {
|
|
db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
|
|
db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
|
|
|
|
+ } else if tag == "strategy_ids" {
|
|
|
|
+ strategyIds := strings.Split(fmt.Sprintf("%v", value.Interface()), ",")
|
|
|
|
+ var strategyIdList []int
|
|
|
|
+ for _, strategyId := range strategyIds {
|
|
|
|
+ strategyIdList = append(strategyIdList, conv.MustInt(strategyId, 0))
|
|
|
|
+ }
|
|
|
|
+ db = db.Where("strategy_id in ?", strategyIdList)
|
|
|
|
+ } else {
|
|
|
|
+ db = db.Where(fmt.Sprintf("%s like '%%%v%%'", tag, value.Interface()))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -119,8 +127,6 @@ func GetTaskDataList(ctx context.Context, projectID string, pageSize, pageNum in
|
|
newTaskDatas = append(newTaskDatas, v)
|
|
newTaskDatas = append(newTaskDatas, v)
|
|
} else if strings.Contains(v.PlatformNickname, platform_nickname) {
|
|
} else if strings.Contains(v.PlatformNickname, platform_nickname) {
|
|
newTaskDatas = append(newTaskDatas, v)
|
|
newTaskDatas = append(newTaskDatas, v)
|
|
- } else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
|
|
|
|
- newTaskDatas = append(newTaskDatas, v)
|
|
|
|
} else {
|
|
} else {
|
|
totalTask--
|
|
totalTask--
|
|
}
|
|
}
|