|
@@ -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
|