xuzhiheng 1 年間 前
コミット
6b88ba064c
1 ファイル変更19 行追加19 行削除
  1. 19 19
      service/company.go

+ 19 - 19
service/company.go

@@ -94,28 +94,23 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq) *biservice.Distri
 					positionId := common.Int64All(vv["position_id"])
 					ppMap[positionId] = 0
 				}
-				isOk, sindex := false, 0
-				for _, vv := range v {
-				L:
-					for pa, _ := range ppMap {
-						if pa > 0 {
-							for n, r := range rdata {
-								if r.PositionId == pa {
-									if this.DataType == 1 {
+				isOk, sindex, paid := false, 0, int64(0)
+			L:
+				for pa, _ := range ppMap {
+					if pa > 0 {
+						for n, r := range rdata {
+							if r.PositionId == pa {
+								if this.DataType == 1 {
+									isOk = true
+									sindex = n
+									paid = pa
+									break L
+								} else {
+									if rdata[n].CompanyCounts < rdata[n].CompanyCount {
 										isOk = true
 										sindex = n
-										rdata[n].ClueCount++
+										paid = pa
 										break L
-									} else {
-										if rdata[n].CompanyCounts < rdata[n].CompanyCount {
-											isOk = true
-											sindex = n
-											rdata[n].ClueCount++
-											if this.DataType == 3 {
-												dclue(vv, pa, this.IsTask, this.PositionId) //分线索
-											}
-											break L
-										}
 									}
 								}
 							}
@@ -127,8 +122,13 @@ func DistributeClueShow(this *biservice.DistributeClueShowReq) *biservice.Distri
 						rdata[sindex].CompanyCount++
 						rdata[sindex].MinCount++
 						rdata[sindex].CompanyCounts++
+						rdata[sindex].ClueCount += int64(len(v))
 					} else {
 						rdata[sindex].CompanyCounts++
+						rdata[sindex].ClueCount += int64(len(v))
+						for _, vv := range v {
+							dclue(vv, paid, this.IsTask, this.PositionId) //分线索
+						}
 					}
 				}
 			}