|
@@ -3,8 +3,6 @@ package db
|
|
|
import (
|
|
|
"context"
|
|
|
"fmt"
|
|
|
- "github.com/caixw/lib.go/conv"
|
|
|
- "github.com/sirupsen/logrus"
|
|
|
"reflect"
|
|
|
"strings"
|
|
|
"youngee_m_api/consts"
|
|
@@ -13,6 +11,9 @@ import (
|
|
|
"youngee_m_api/model/http_model"
|
|
|
"youngee_m_api/pack"
|
|
|
"youngee_m_api/util"
|
|
|
+
|
|
|
+ "github.com/caixw/lib.go/conv"
|
|
|
+ "github.com/sirupsen/logrus"
|
|
|
)
|
|
|
|
|
|
func CountDefaultNum(ctx context.Context) (error, *http_model.CountNumOfDefaultsResponse) {
|
|
@@ -406,23 +407,12 @@ func GetTaskDefaultReviewList(ctx context.Context, projectID string, pageSize, p
|
|
|
db = db.Where("cur_default_type = 5")
|
|
|
}
|
|
|
continue
|
|
|
- }
|
|
|
- if !util.IsBlank(value) {
|
|
|
- logrus.Println("tag: ", tag)
|
|
|
+ } else if !util.IsBlank(value) {
|
|
|
if tag == "platform_nickname" {
|
|
|
platform_nickname = fmt.Sprintf("%v", value.Interface())
|
|
|
continue
|
|
|
- } else if tag == "project_id" {
|
|
|
+ } else if tag == "project_id" || tag == "strategy_id" {
|
|
|
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()))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -491,6 +481,8 @@ func GetTaskDefaultReviewList(ctx context.Context, projectID string, pageSize, p
|
|
|
newTaskDefaultReviews = append(newTaskDefaultReviews, v)
|
|
|
} else if strings.Contains(v.PlatformNickname, platform_nickname) {
|
|
|
newTaskDefaultReviews = append(newTaskDefaultReviews, v)
|
|
|
+ } else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
|
|
|
+ newTaskDefaultReviews = append(newTaskDefaultReviews, v)
|
|
|
} else {
|
|
|
totalTask--
|
|
|
}
|
|
@@ -516,21 +508,11 @@ func GetTaskDefaultDataList(ctx context.Context, projectID string, pageSize, pag
|
|
|
}
|
|
|
continue
|
|
|
} else if !util.IsBlank(value) {
|
|
|
- logrus.Println("tag: ", tag)
|
|
|
if tag == "platform_nickname" {
|
|
|
platform_nickname = fmt.Sprintf("%v", value.Interface())
|
|
|
continue
|
|
|
- } else if tag == "project_id" {
|
|
|
+ } else if tag == "project_id" || tag == "strategy_id" {
|
|
|
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()))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -605,6 +587,8 @@ func GetTaskDefaultDataList(ctx context.Context, projectID string, pageSize, pag
|
|
|
newTaskDefaultDatas = append(newTaskDefaultDatas, v)
|
|
|
} else if strings.Contains(v.PlatformNickname, platform_nickname) {
|
|
|
newTaskDefaultDatas = append(newTaskDefaultDatas, v)
|
|
|
+ } else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
|
|
|
+ newTaskDefaultDatas = append(newTaskDefaultDatas, v)
|
|
|
} else {
|
|
|
totalTask--
|
|
|
}
|
|
@@ -652,21 +636,11 @@ func GetTaskTerminatingList(ctx context.Context, projectID string, pageSize, pag
|
|
|
}
|
|
|
continue
|
|
|
} else if !util.IsBlank(value) {
|
|
|
- logrus.Println("tag: ", tag)
|
|
|
if tag == "platform_nickname" {
|
|
|
platform_nickname = fmt.Sprintf("%v", value.Interface())
|
|
|
continue
|
|
|
- } else if tag == "project_id" {
|
|
|
- db1 = db1.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))
|
|
|
- }
|
|
|
- db1 = db1.Where("strategy_id in ?", strategyIdList)
|
|
|
- } else {
|
|
|
- db1 = db1.Where(fmt.Sprintf("%s like '%%%v%%'", tag, value.Interface()))
|
|
|
+ } else if tag == "project_id" || tag == "strategy_id" {
|
|
|
+ db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -722,6 +696,8 @@ func GetTaskTerminatingList(ctx context.Context, projectID string, pageSize, pag
|
|
|
newTaskTerminatings = append(newTaskTerminatings, v)
|
|
|
} else if strings.Contains(v.PlatformNickname, platform_nickname) {
|
|
|
newTaskTerminatings = append(newTaskTerminatings, v)
|
|
|
+ } else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
|
|
|
+ newTaskTerminatings = append(newTaskTerminatings, v)
|
|
|
} else {
|
|
|
totalTask--
|
|
|
}
|
|
@@ -748,21 +724,11 @@ func GetTaskTerminatedList(ctx context.Context, projectID string, pageSize, page
|
|
|
}
|
|
|
continue
|
|
|
} else if !util.IsBlank(value) {
|
|
|
- logrus.Println("tag: ", tag)
|
|
|
if tag == "platform_nickname" {
|
|
|
platform_nickname = fmt.Sprintf("%v", value.Interface())
|
|
|
continue
|
|
|
- } else if tag == "project_id" {
|
|
|
+ } else if tag == "project_id" || tag == "strategy_id" {
|
|
|
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()))
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -838,6 +804,8 @@ func GetTaskTerminatedList(ctx context.Context, projectID string, pageSize, page
|
|
|
newTaskTerminateds = append(newTaskTerminateds, v)
|
|
|
} else if strings.Contains(v.PlatformNickname, platform_nickname) {
|
|
|
newTaskTerminateds = append(newTaskTerminateds, v)
|
|
|
+ } else if strings.Contains(conv.MustString(v.TaskID, ""), platform_nickname) {
|
|
|
+ newTaskTerminateds = append(newTaskTerminateds, v)
|
|
|
} else {
|
|
|
totalTask--
|
|
|
}
|