瀏覽代碼

feat:找人脉调整

wangchuanjin 10 月之前
父節點
當前提交
3536419382
共有 1 個文件被更改,包括 2 次插入6 次删除
  1. 2 6
      api/internal/service/initNetwork.go

+ 2 - 6
api/internal/service/initNetwork.go

@@ -68,11 +68,10 @@ func (i *InitNetwork) Init() {
 		if i.BusinessType == "" {
 			return
 		}
-		m := map[string]*Connection{}
 		args := []interface{}{i.EntName}
 		wh, newArgs := util.WhArgs(strings.Split(i.BusinessType, ","))
 		args = append(args, newArgs...)
-		rows, err := ClickhouseConn.Query(context.Background(), `select DISTINCT winner_id,winner from information.transaction_info_all WHERE buyer_id IN (SELECT buyer_id from information.transaction_info_all WHERE has(winner,?) and buyer_id<>'') AND hasAny(topscopeclass,[`+wh+`])`, args...)
+		rows, err := ClickhouseConn.Query(context.Background(), `select DISTINCT winner_id,winner from information.transaction_info_all WHERE buyer_id IN (SELECT buyer_id from information.transaction_info_all WHERE has(winner,?) and buyer_id<>'') AND hasAny(topscopeclass,[`+wh+`])=0`, args...)
 		if err != nil {
 			logx.Error(err)
 			return
@@ -95,9 +94,6 @@ func (i *InitNetwork) Init() {
 					Company_name: winners[k],
 					Itype:        3,
 				}
-				if m[winner_id] != nil {
-					continue
-				}
 				ids = append(ids, winner_id)
 				array = append(array, cn)
 			}
@@ -146,7 +142,7 @@ func (i *InitNetwork) Init() {
 	index := 0
 	typeLimit := map[int]int{}
 	for _, v := range array {
-		if v.ContactInfo == nil || v.ContactInfo.Phone == "" || v.ContactInfo.Name == "" {
+		if v.Company_name == i.EntName || v.ContactInfo == nil || v.ContactInfo.Phone == "" || v.ContactInfo.Name == "" {
 			continue
 		} else if typeLimit[v.Itype] >= 100 {
 			continue