Browse Source

feat:xiugai

wangchuanjin 1 year ago
parent
commit
4177a1774a
2 changed files with 6 additions and 4 deletions
  1. 5 3
      api/internal/service/CoopHistoryService.go
  2. 1 1
      api/internal/service/owner.go

+ 5 - 3
api/internal/service/CoopHistoryService.go

@@ -330,12 +330,14 @@ func LastTimeCoop(buyerId, ent, stype string) (bool, int64) {
 }
 
 //
-func LastTimeCoopBath(buyerIds, winners, agencys []string) (map[string]map[string]*Cooperate, map[string]map[string]*Cooperate) {
+func LastTimeCoopBath(positionId int64, buyerIds, winners, agencys []string) (map[string]map[string]*Cooperate, map[string]map[string]*Cooperate) {
 	adiffb, agency := map[string]map[string]*Cooperate{}, map[string]map[string]*Cooperate{}
 	if len(buyerIds) == 0 {
 		return adiffb, agency
 	}
 	var toSearch = func(tp int, query string, args []interface{}) {
+		logx.Info("LastTimeCoopBath once start", positionId)
+		defer logx.Info("LastTimeCoopBath once over", positionId)
 		rows, err := T.ClickhouseConn.Query(context.Background(), query, args...)
 		if err != nil {
 			logx.Error(err)
@@ -384,7 +386,7 @@ func LastTimeCoopBath(buyerIds, winners, agencys []string) (map[string]map[strin
 			for _, vv := range winners {
 				args = append(args, v, vv)
 				array = append(array, text)
-				if len(array) == 200 {
+				if len(array) == 50 {
 					toSearch(1, fmt.Sprintf(sql, strings.Join(array, " or ")), args)
 					array = []string{}
 					args = []interface{}{}
@@ -404,7 +406,7 @@ func LastTimeCoopBath(buyerIds, winners, agencys []string) (map[string]map[strin
 			for _, vv := range winners {
 				args = append(args, v, vv)
 				array = append(array, text)
-				if len(array) == 200 {
+				if len(array) == 50 {
 					toSearch(2, fmt.Sprintf(sql, strings.Join(array, " or ")), args)
 					array = []string{}
 					args = []interface{}{}

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

@@ -1141,7 +1141,7 @@ func (t *OwnerService) CandidateChannel() (*ResultDatas, int, int, int, int) {
 				agency = append(agency, common.ObjToString(m["name"]))
 			}
 		}
-		ltcs1, ltcs2 := LastTimeCoopBath(buyerIds, winners, agency)
+		ltcs1, ltcs2 := LastTimeCoopBath(t.PositionId, buyerIds, winners, agency)
 		logx.Info("CandidateChannel LastTimeCoopBath over", t.PositionId)
 		pool := make(chan bool, 3)
 		wait := &sync.WaitGroup{}