Browse Source

feat:xiugai

wangchuanjin 9 months ago
parent
commit
7ef06fbf2c
2 changed files with 3 additions and 11 deletions
  1. 2 10
      api/internal/service/network.go
  2. 1 1
      api/internal/service/owner.go

+ 2 - 10
api/internal/service/network.go

@@ -1058,8 +1058,6 @@ func (n *network) Introduce_Supplier(values []string, businessType []string) map
 		return map[string]*projectInfo{}
 	}
 	vbs := map[string][]*idName{}
-	vm := map[string]bool{}
-	ids := []string{}
 	for rows.Next() {
 		var (
 			winner_id []string
@@ -1078,10 +1076,6 @@ func (n *network) Introduce_Supplier(values []string, businessType []string) map
 			buyers = append(buyers, buyer_id)
 		}
 		for _, v := range winner_id {
-			if !vm[v] {
-				ids = append(ids, v)
-			}
-			vm[v] = true
 			if whRepeat[v] != nil && whRepeat[v][buyer_id] {
 				continue
 			}
@@ -1099,7 +1093,7 @@ func (n *network) Introduce_Supplier(values []string, businessType []string) map
 	if err := rows.Err(); err != nil {
 		logx.Error(err)
 	}
-	return n.MakeProjectInfo(nil, ids, vbs, businessType)
+	return n.MakeProjectInfo(nil, values, vbs, businessType)
 }
 
 func (n *network) Introduce_Agency(values []string, businessType []string) map[string]*projectInfo {
@@ -1114,7 +1108,6 @@ func (n *network) Introduce_Agency(values []string, businessType []string) map[s
 		return map[string]*projectInfo{}
 	}
 	vbs := map[string][]*idName{}
-	ids := []string{}
 	buyers := []string{}
 	repeat := map[string]bool{}
 	for rows.Next() {
@@ -1130,7 +1123,6 @@ func (n *network) Introduce_Agency(values []string, businessType []string) map[s
 		if buyer_id == "" || buyer == "" {
 			continue
 		}
-		ids = append(ids, agency_id)
 		vbs[agency_id] = append(vbs[agency_id], &idName{
 			Id:   buyer_id,
 			Name: buyer,
@@ -1144,7 +1136,7 @@ func (n *network) Introduce_Agency(values []string, businessType []string) map[s
 	if err := rows.Err(); err != nil {
 		logx.Error(err)
 	}
-	return n.MakeProjectInfo(ids, nil, vbs, businessType)
+	return n.MakeProjectInfo(values, nil, vbs, businessType)
 }
 
 func (n *network) Introduce_Middleman_Buyer(values []string, businessType []string) map[string]*projectInfo {

+ 1 - 1
api/internal/service/owner.go

@@ -727,7 +727,7 @@ func (t *OwnerService) ProjectHandle(buyerArr []string, businessStr string, moni
 		allArgs = append(allArgs, args...)
 	}
 	if len(ors2) > 0 {
-		ors1 = append(ors1, `(buyer_id in (select buyer_id from transaction_info_all where (`+strings.Join(ors2, " or ")+`) and buyer_id<>''))`)
+		ors1 = append(ors1, `(buyer_id in (select DISTINCT buyer_id from transaction_info_all where (`+strings.Join(ors2, " or ")+`) and buyer_id<>''))`)
 	}
 	ands := []string{}
 	if len(monitorBuyers) > 0 {