|
@@ -219,7 +219,7 @@ func GetSpecialTaskInviteList(ctx context.Context, projectID string, pageSize, p
|
|
|
// 根据Project条件过滤
|
|
|
conditionType := reflect.TypeOf(conditions).Elem()
|
|
|
conditionValue := reflect.ValueOf(conditions).Elem()
|
|
|
- var platform_nickname string = ""
|
|
|
+ var platformNickname string = ""
|
|
|
for i := 0; i < conditionType.NumField(); i++ {
|
|
|
field := conditionType.Field(i)
|
|
|
tag := field.Tag.Get("condition")
|
|
@@ -234,7 +234,7 @@ func GetSpecialTaskInviteList(ctx context.Context, projectID string, pageSize, p
|
|
|
continue
|
|
|
} else if !util.IsBlank(value) {
|
|
|
if tag == "platform_nickname" {
|
|
|
- platform_nickname = fmt.Sprintf("%v", value.Interface())
|
|
|
+ platformNickname = fmt.Sprintf("%v", value.Interface())
|
|
|
continue
|
|
|
} else if tag == "project_id" {
|
|
|
db = db.Where(fmt.Sprintf("%s = ?", tag), value.Interface())
|
|
@@ -251,26 +251,34 @@ func GetSpecialTaskInviteList(ctx context.Context, projectID string, pageSize, p
|
|
|
}
|
|
|
db.Order("task_id").Find(&taskInfos)
|
|
|
|
|
|
- // 查询该页数据
|
|
|
- limit := pageSize
|
|
|
- offset := pageSize * pageNum // assert pageNum start with 0
|
|
|
- err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
|
|
|
- if err != nil {
|
|
|
- logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
|
|
|
- return nil, 0, err
|
|
|
+ talentInfoTophoneMap := make(map[string]string)
|
|
|
+ for _, taskInfo := range taskInfos {
|
|
|
+ if _, ok := talentInfoTophoneMap[taskInfo.TalentID]; !ok {
|
|
|
+ phone := GetPhoneFromTalentId(ctx, taskInfo.TalentID)
|
|
|
+ talentInfoTophoneMap[taskInfo.TalentID] = phone
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ //// 查询该页数据
|
|
|
+ //limit := pageSize
|
|
|
+ //offset := pageSize * pageNum // assert pageNum start with 0
|
|
|
+ //err := db.Order("task_id").Limit(int(limit)).Offset(int(offset)).Error
|
|
|
+ //if err != nil {
|
|
|
+ // logrus.WithContext(ctx).Errorf("[GetProjectTaskList] error query mysql total, err:%+v", err)
|
|
|
+ // return nil, 0, err
|
|
|
+ //}
|
|
|
+
|
|
|
var taskDatas []*http_model.SpecialTaskInviteInfo
|
|
|
var newTaskDatas []*http_model.SpecialTaskInviteInfo
|
|
|
|
|
|
taskDatas = pack.YoungeeTaskInfoToSpecialTaskInviteInfo(taskInfos)
|
|
|
|
|
|
for _, v := range taskDatas {
|
|
|
- if platform_nickname == "" {
|
|
|
+ if platformNickname == "" {
|
|
|
newTaskDatas = append(newTaskDatas, v)
|
|
|
- } else if strings.Contains(v.PlatformNickname, platform_nickname) {
|
|
|
+ } else if strings.Contains(v.PlatformNickname, platformNickname) {
|
|
|
newTaskDatas = append(newTaskDatas, v)
|
|
|
- } else if strings.Contains(conv.MustString(v.TaskID), platform_nickname) {
|
|
|
+ } else if strings.Contains(conv.MustString(v.TaskID), platformNickname) {
|
|
|
newTaskDatas = append(newTaskDatas, v)
|
|
|
} else {
|
|
|
totalTask--
|
|
@@ -279,6 +287,13 @@ func GetSpecialTaskInviteList(ctx context.Context, projectID string, pageSize, p
|
|
|
return newTaskDatas, totalTask, nil
|
|
|
}
|
|
|
|
|
|
+func GetPhoneFromTalentId(ctx context.Context, talentId string) string {
|
|
|
+ db := GetReadDB(ctx)
|
|
|
+ var Phone string
|
|
|
+ db.Model(&gorm_model.YoungeeTalentInfo{}).Select("talent_phone_number").Where("id = ?", talentId).Find(&Phone)
|
|
|
+ return Phone
|
|
|
+}
|
|
|
+
|
|
|
func SetTalentIncome(ctx context.Context, TaskIDs []string) error {
|
|
|
db := GetReadDB(ctx)
|
|
|
var TaskInfoList []gorm_model.YoungeeTaskInfo
|