소스 검색

情报id返回

WH01243 1 년 전
부모
커밋
cc127b7307
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      api/internal/service/employService.go

+ 6 - 4
api/internal/service/employService.go

@@ -798,13 +798,13 @@ func employInfoEnt(table, employKey, findKey, depIDArr string, in *types.InfoEmp
 		orderKey = "source"
 	}
 	if len(infoId1Arr) > 0 {
-		infoData1 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  %s,GROUP_CONCAT(id) as  employIdArr,MAX(is_ignore) as is_ignore,MAX(status) as status from  %s   where %s in ('%s') and  source=? and    ent_dept_id in  (%s) GROUP BY %s ,%s order  by %s", employKey, table, employKey, strings.Join(infoId1Arr, "','"), depIDArr, employKey, orderKey, orderKey), 1)
+		infoData1 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select  %s,GROUP_CONCAT(id) as  employIdArr,MAX(is_ignore) as is_ignore,MAX(status) as status,%s from  %s   where %s in ('%s') and  source=? and    ent_dept_id in  (%s) GROUP BY %s ,%s order  by %s", employKey, orderKey, table, employKey, strings.Join(infoId1Arr, "','"), depIDArr, employKey, orderKey, orderKey), 1)
 	}
 	if len(infoId2Arr) > 0 {
-		infoData2 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s, GROUP_CONCAT(id) as  employIdArr,MAX(is_ignore) as is_ignore,MAX(status) as status from  %s   where %s in ('%s') and  source=? and    ent_dept_id in  (%s)  GROUP BY %s ,%s order  by %s", employKey, table, employKey, strings.Join(infoId2Arr, "','"), depIDArr, employKey, orderKey, orderKey), 2)
+		infoData2 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s, GROUP_CONCAT(id) as  employIdArr,MAX(is_ignore) as is_ignore,MAX(status) as status,%s from  %s   where %s in ('%s') and  source=? and    ent_dept_id in  (%s)  GROUP BY %s ,%s order  by %s", employKey, orderKey, table, employKey, strings.Join(infoId2Arr, "','"), depIDArr, employKey, orderKey, orderKey), 2)
 	}
 	if len(niJianIdArr) > 0 {
-		niJianData = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s, GROUP_CONCAT(id) as  employIdArr,MAX(is_ignore) as is_ignore,MAX(status) as status from  %s   where %s  in ('%s') and  source=? and    ent_dept_id in  (%s) GROUP BY %s ,%s order  by %s", employKey, table, employKey, strings.Join(niJianIdArr, "','"), depIDArr, employKey, orderKey, orderKey), 2)
+		niJianData = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s, GROUP_CONCAT(id) as  employIdArr,MAX(is_ignore) as is_ignore,MAX(status) as status,%s from  %s   where %s  in ('%s') and  source=? and    ent_dept_id in  (%s) GROUP BY %s ,%s order  by %s", employKey, orderKey, table, employKey, strings.Join(niJianIdArr, "','"), depIDArr, employKey, orderKey, orderKey), 2)
 	}
 	if len(wuye1Arr) > 0 {
 		wuyeData1 = MC.CrmMysql.SelectBySql(fmt.Sprintf("select %s,  id,is_ignore,status,%s   from  %s   where %s in ('%s')  and status =1 and  source=? and    ent_dept_id in  (%s)  GROUP BY %s  ,%s order  by %s", employKey, orderKey, table, employKey, strings.Join(wuye1Arr, "','"), depIDArr, employKey, orderKey, orderKey), 1)
@@ -937,7 +937,6 @@ func EmployHandle(valueMap map[string]interface{}, employData map[string]interfa
 			if employStatus == 1 {
 				employ2 = true
 			}
-			valueMap["intelligenceId"] = employId
 		case 3:
 			if valueMap["employ2"] != nil {
 				employ2 = gconv.Bool(valueMap["employ2"])
@@ -967,6 +966,9 @@ func EmployHandle(valueMap map[string]interface{}, employData map[string]interfa
 		valueMap["type"] = common.Int64All(employData["type"])
 		valueMap["employId"] = employId
 	}
+	if employType == 2 {
+		valueMap["intelligenceId"] = employId
+	}
 	if single && employArrStr != "" {
 		//列表查询
 		//是否忽略处理