...
|
...
|
@@ -699,6 +699,7 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail |
|
|
provider *protocol.BaseUserInfo
|
|
|
approveProcess *protocol.ChanceApproveProcessResponse
|
|
|
)
|
|
|
rsp = &protocol.ChanceDetailResponse{}
|
|
|
if chance, err = models.GetChanceById(request.Id); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
err = protocol.NewErrWithMessage(5101)
|
...
|
...
|
@@ -707,13 +708,16 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail |
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if chance.EnableStatus == 0 {
|
|
|
err = protocol.NewErrWithMessage(5101)
|
|
|
return
|
|
|
}
|
|
|
//用户信息
|
|
|
if provider, err = agg.GetUserBaseInfo(chance.UserId, header.CompanyId); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
rsp = &protocol.ChanceDetailResponse{}
|
|
|
item := protocol.ChanceItem{
|
|
|
Id: chance.Id,
|
|
|
Provider: provider,
|
...
|
...
|
@@ -742,6 +746,7 @@ func ChanceDelete(header *protocol.RequestHeader, request *protocol.ChanceDelete |
|
|
var (
|
|
|
chance *models.Chance
|
|
|
)
|
|
|
rsp = &protocol.ChanceDeleteResponse{}
|
|
|
if chance, err = models.GetChanceById(request.Id); err != nil {
|
|
|
if err == orm.ErrNoRows {
|
|
|
err = protocol.NewErrWithMessage(5101)
|
...
|
...
|
@@ -750,8 +755,24 @@ func ChanceDelete(header *protocol.RequestHeader, request *protocol.ChanceDelete |
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if chance != nil {
|
|
|
if chance.ReviewStatus == protocol.ReviewStatusPass {
|
|
|
err = protocol.NewErrWithMessage(5202)
|
|
|
return
|
|
|
}
|
|
|
//被人审核过 公开状态数据不为空
|
|
|
if chance.ReviewStatus == protocol.ReviewStatusAuditging && len(chance.PublishData) != 0 {
|
|
|
err = protocol.NewErrWithMessage(5202)
|
|
|
return
|
|
|
}
|
|
|
if err = utils.UpdateTableByMap(chance, map[string]interface{}{
|
|
|
"EnableStatus": int8(0),
|
|
|
}); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
if err = models.CloseAuditFlowProcess(chance.Id); err != nil {
|
|
|
log.Error(err)
|
|
|
return
|
|
|
}
|
|
|
rsp = &protocol.ChanceDeleteResponse{}
|
|
|
return
|
|
|
} |
...
|
...
|
|