...
|
...
|
@@ -14,14 +14,14 @@ func GetChancePool(uid, cid int64, chanceTypeId int, lastId int64, pageSize int, |
|
|
checkMap map[int]int
|
|
|
specialDIds []int64
|
|
|
userDIds []int64
|
|
|
company *models.Company
|
|
|
user *models.User
|
|
|
)
|
|
|
if company, err = models.GetCompanyById(cid); err != nil {
|
|
|
if user, err = models.GetUserByCompanyId(cid); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
//公司管理员有所有权限
|
|
|
if company.AdminId == uid {
|
|
|
if user.Id == uid {
|
|
|
check = 4
|
|
|
} else {
|
|
|
if op, e := GetUserPermission(uid); e == nil {
|
...
|
...
|
@@ -35,7 +35,7 @@ func GetChancePool(uid, cid int64, chanceTypeId int, lastId int64, pageSize int, |
|
|
specialDIds = append(specialDIds, 0)
|
|
|
}
|
|
|
}
|
|
|
log.Debug(fmt.Sprintf("user:%v check:%v is_amdin:%v", uid, check, company.AdminId == uid))
|
|
|
log.Debug(fmt.Sprintf("user:%v check:%v is_amdin:%v", uid, check, user.Id == uid))
|
|
|
switch check {
|
|
|
case OpportunityCheckLv1:
|
|
|
return models.GetChancePoolMyself(uid, cid, chanceTypeId, lastId, pageSize, v)
|
...
|
...
|
@@ -69,14 +69,14 @@ func ValidChancePermission(uid, cid int64, items []*protocol.CommonListItem) (er |
|
|
checkMap map[int]int
|
|
|
specialDIds []int64
|
|
|
userDIds []int64
|
|
|
company *models.Company
|
|
|
user *models.User
|
|
|
)
|
|
|
if company, err = models.GetCompanyById(cid); err != nil {
|
|
|
if user, err = models.GetUserByCompanyId(cid); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
//公司管理员有所有权限
|
|
|
if company.AdminId == uid {
|
|
|
if user.Id == uid {
|
|
|
check = 4
|
|
|
} else {
|
|
|
if op, e := GetUserPermission(uid); e == nil {
|
...
|
...
|
@@ -93,7 +93,7 @@ func ValidChancePermission(uid, cid int64, items []*protocol.CommonListItem) (er |
|
|
specialDIds = append(specialDIds, 0)
|
|
|
}
|
|
|
}
|
|
|
log.Debug(fmt.Sprintf("user:%v check:%v is_admin:%v", uid, check, company.AdminId == uid))
|
|
|
log.Debug(fmt.Sprintf("user:%v check:%v is_admin:%v", uid, check, user.Id == uid))
|
|
|
for i := range items {
|
|
|
if items[i].ChanceStatus != 0 {
|
|
|
continue
|
...
|
...
|
|