...
|
...
|
@@ -115,11 +115,15 @@ func ValidChancePermission(uid, cid int64, items []*protocol.CommonListItem) (er |
|
|
var chancePublicStatus = items[i].Chance.PublicStatus
|
|
|
var chanceUserId = items[i].Chance.Provider.UserId
|
|
|
var chanceId = items[i].ChanceId
|
|
|
|
|
|
if chanceUserId == uid {
|
|
|
continue
|
|
|
}
|
|
|
switch check {
|
|
|
case OpportunityCheckLv1:
|
|
|
if chanceUserId == uid {
|
|
|
continue
|
|
|
}
|
|
|
//if chanceUserId == uid {
|
|
|
// continue
|
|
|
//}
|
|
|
if _, e := models.ExitsChanceByAuditUser(chanceId, uid); e == nil {
|
|
|
continue
|
|
|
}
|
...
|
...
|
@@ -128,9 +132,9 @@ func ValidChancePermission(uid, cid int64, items []*protocol.CommonListItem) (er |
|
|
if chancePublicStatus == protocol.PublicToCompany {
|
|
|
continue
|
|
|
}
|
|
|
if chanceUserId == uid {
|
|
|
continue
|
|
|
}
|
|
|
//if chanceUserId == uid {
|
|
|
// continue
|
|
|
//}
|
|
|
if chancePublicStatus == protocol.PublicToDepartment {
|
|
|
if len(userDIds) == 0 {
|
|
|
if e := models.GetUserDepartmentIds(uid, cid, &userDIds); e != nil {
|
...
|
...
|
@@ -138,7 +142,7 @@ func ValidChancePermission(uid, cid int64, items []*protocol.CommonListItem) (er |
|
|
return
|
|
|
}
|
|
|
}
|
|
|
if _, e := models.ExitsChanceByPublicDeparmentIds(chanceId, userDIds); e == nil {
|
|
|
if _, e := models.ExitsChanceByDeparmentIds(chanceId, userDIds); e == nil {
|
|
|
continue
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -147,10 +151,13 @@ func ValidChancePermission(uid, cid int64, items []*protocol.CommonListItem) (er |
|
|
}
|
|
|
items[i].ChanceStatus = protocol.ChanceStatusClose
|
|
|
case OpportunityCheckLv3:
|
|
|
if chanceUserId == uid {
|
|
|
continue
|
|
|
}
|
|
|
//if chanceUserId == uid {
|
|
|
// continue
|
|
|
//}
|
|
|
if _, ok := checkMap[OpportunityCheckLv2]; ok { //同时存在对部门公开的机会
|
|
|
if chancePublicStatus == protocol.PublicToCompany {
|
|
|
continue
|
|
|
}
|
|
|
if chancePublicStatus == protocol.PublicToDepartment {
|
|
|
if len(userDIds) == 0 {
|
|
|
if e := models.GetUserDepartmentIds(uid, cid, &userDIds); e != nil {
|
...
|
...
|
@@ -158,7 +165,7 @@ func ValidChancePermission(uid, cid int64, items []*protocol.CommonListItem) (er |
|
|
return
|
|
|
}
|
|
|
}
|
|
|
if _, e := models.ExitsChanceByPublicDeparmentIds(chanceId, userDIds); e == nil {
|
|
|
if _, e := models.ExitsChanceByDeparmentIds(chanceId, userDIds); e == nil {
|
|
|
continue
|
|
|
}
|
|
|
}
|
...
|
...
|
|