作者 yangfu

Merge remote-tracking branch 'origin/test' into dev

... ... @@ -36,7 +36,7 @@ func (this *AuthController) Login() {
return
}
header := controllers.GetRequestHeader(this.Ctx)
if beego.BConfig.RunMode == "prod" || beego.BConfig.RunMode == "test1" {
if beego.BConfig.RunMode == "prod" || beego.BConfig.RunMode == "test" {
msg = protocol.NewReturnResponse(auth.LoginV3(header, request))
return
}
... ...
... ... @@ -137,7 +137,7 @@ func (this *UserController) SwitchCompany() {
return
}
header := controllers.GetRequestHeader(this.Ctx)
if beego.BConfig.RunMode == "prod" || beego.BConfig.RunMode == "test1" {
if beego.BConfig.RunMode == "prod" || beego.BConfig.RunMode == "test" {
msg = protocol.NewReturnResponse(user.SwitchCompanyV3(header, request))
return
}
... ... @@ -162,7 +162,7 @@ func (this *UserController) UserInfo() {
return
}
header := controllers.GetRequestHeader(this.Ctx)
if beego.BConfig.RunMode == "prod" || beego.BConfig.RunMode == "test1" {
if beego.BConfig.RunMode == "prod" || beego.BConfig.RunMode == "test" {
msg = protocol.NewReturnResponse(user.UserInfoV3(header, request))
return
}
... ...
... ... @@ -1526,6 +1526,9 @@ func ChanceStatistics(header *protocol.RequestHeader, request *protocol.ChanceSt
item := chanceType[i]
if total, err = agg.GetChancePool(header.UserId, header.CompanyId, models.NewChancePoolOption(item.Id, []int{}, models.ChancePool, 0), 0, false, 0, 0, nil); err != nil {
log.Error(err)
if err == orm.ErrNoRows {
err = nil
}
return
}
sum += total
... ... @@ -2222,6 +2225,10 @@ func Permission(header *protocol.RequestHeader, request *protocol.PermissionRequ
if chance.UserId != header.UserId && chance.ReviewStatus == protocol.ReviewStatusReturn {
noPermission()
}
//机会 已经在审核中的 本来即使是管理员也没有权限
if chance.UserId == header.UserId && chance.ReviewStatus == protocol.ReviewStatusAuditging && len(chance.ApproveData) > 0 {
noPermission()
}
return
}
//机会关闭 / 删除
... ...