作者 yangfu

参与人数修改

... ... @@ -1703,14 +1703,21 @@ func (cooperationContractService *CooperationContractService) UpdateCooperationP
return err
}
var count = 0
var mapDupUser = make(map[int64]int64)
var funcRemoveDuplicate = func(userBaseId int64) {
if _, ok := mapDupUser[userBaseId]; !ok {
mapDupUser[userBaseId] = userBaseId
count += 1 // 默认承接人
}
}
for i := range underTakers {
item := underTakers[i]
count += 1 // 默认承接人
funcRemoveDuplicate(item.Undertaker.UserBaseId)
if item.Undertaker.Referrer != nil && item.Undertaker.Referrer.UserBaseId != 0 {
count += 1
funcRemoveDuplicate(item.Undertaker.Referrer.UserBaseId)
}
if item.Undertaker.Salesman != nil && item.Undertaker.Salesman.UserBaseId != 0 {
count += 1
funcRemoveDuplicate(item.Undertaker.Salesman.UserBaseId)
}
}
project.ApplicantCount = int32(count)
... ...