作者 yangfu

参与人数修改

@@ -1703,14 +1703,21 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationP @@ -1703,14 +1703,21 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationP
1703 return err 1703 return err
1704 } 1704 }
1705 var count = 0 1705 var count = 0
  1706 + var mapDupUser = make(map[int64]int64)
  1707 + var funcRemoveDuplicate = func(userBaseId int64) {
  1708 + if _, ok := mapDupUser[userBaseId]; !ok {
  1709 + mapDupUser[userBaseId] = userBaseId
  1710 + count += 1 // 默认承接人
  1711 + }
  1712 + }
1706 for i := range underTakers { 1713 for i := range underTakers {
1707 item := underTakers[i] 1714 item := underTakers[i]
1708 - count += 1 // 默认承接人 1715 + funcRemoveDuplicate(item.Undertaker.UserBaseId)
1709 if item.Undertaker.Referrer != nil && item.Undertaker.Referrer.UserBaseId != 0 { 1716 if item.Undertaker.Referrer != nil && item.Undertaker.Referrer.UserBaseId != 0 {
1710 - count += 1 1717 + funcRemoveDuplicate(item.Undertaker.Referrer.UserBaseId)
1711 } 1718 }
1712 if item.Undertaker.Salesman != nil && item.Undertaker.Salesman.UserBaseId != 0 { 1719 if item.Undertaker.Salesman != nil && item.Undertaker.Salesman.UserBaseId != 0 {
1713 - count += 1 1720 + funcRemoveDuplicate(item.Undertaker.Salesman.UserBaseId)
1714 } 1721 }
1715 } 1722 }
1716 project.ApplicantCount = int32(count) 1723 project.ApplicantCount = int32(count)