作者 yangfu

我的机会修改

... ... @@ -35,6 +35,7 @@ var errmessge ErrorMap = map[int]string{
//机会相关
5101: "该机会已被删除",
5102: "该机会已被关闭或没有权限查看",
//机会审批相关
5201: "该机会模板未配置审批人,请选择其他模板",
... ...
... ... @@ -1664,6 +1664,10 @@ func MyComment(header *protocol.RequestHeader, request *protocol.MyCommentReques
return
}
rsp = &protocol.MyCommentResponse{Total: total}
if provider, err = agg.GetUserBaseInfo(header.UserId, header.CompanyId); err != nil {
log.Error(err)
return
}
for i := 0; i < len(myChances); i++ {
chance := myChances[i]
commItem := &protocol.CommonListItem{}
... ... @@ -1678,13 +1682,6 @@ func MyComment(header *protocol.RequestHeader, request *protocol.MyCommentReques
if chance.Status == models.ChanceStatusClose { //机会关闭
commItem.ChanceStatus = protocol.ChanceStatusClose
}
if provider, err = agg.GetUserBaseInfo(chance.ChanceUserId, header.CompanyId); err != nil {
commItem.ChanceStatus = protocol.ChanceStatusDelete
err = nil
log.Error(err)
commItem.Chance = protocol.ChanceItem{}
//return
} else {
item := protocol.ChanceItem{
Id: chance.SourceId,
Provider: provider,
... ... @@ -1697,22 +1694,7 @@ func MyComment(header *protocol.RequestHeader, request *protocol.MyCommentReques
jsonUnmarshal(chance.Voices, &item.Speechs)
jsonUnmarshal(chance.Videos, &item.Videos)
commItem.Chance = item
}
commItem.ReviewStatus = chance.ReviewStatus
//{
// var chanceData = protocol.ChanceData{
// ThumbsUpTotal: chance.ZanTotal,
// CommentTotal: chance.CommentTotal,
// PageViewTotal: chance.ViewTotal,
// }
// chanceData.IsThumbsUp, chanceData.IsCollect, _ = getChanceMarkFlag(header, chance.SourceType)
// commItem.ChanceData = chanceData
//}
//{
// //做一次查询 查回所有的模板数据
// commItem.ChanceTemplate = getTemplate(chance.TemplateId)
// commItem.ChanceType = getChanceType(chance.ChanceTypeId)
//}
}
if chance.SourceType == protocol.SourceTypeComment {
commItem.CommentedData = protocol.CommentData{
... ... @@ -1832,6 +1814,10 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail
err = protocol.NewErrWithMessage(5101)
return
}
if chance.Status == models.ChanceStatusClose {
err = protocol.NewErrWithMessage(5102)
return
}
if chance.ReviewStatus == protocol.ReviewStatusPass {
if !utils.ExecuteSqlByRoll(true, agg.GetIncrementSql(table, "view_total", 1, request.Id)) {
//
... ...