|
@@ -1664,6 +1664,10 @@ func MyComment(header *protocol.RequestHeader, request *protocol.MyCommentReques |
|
@@ -1664,6 +1664,10 @@ func MyComment(header *protocol.RequestHeader, request *protocol.MyCommentReques |
1664
|
return
|
1664
|
return
|
1665
|
}
|
1665
|
}
|
1666
|
rsp = &protocol.MyCommentResponse{Total: total}
|
1666
|
rsp = &protocol.MyCommentResponse{Total: total}
|
|
|
1667
|
+ if provider, err = agg.GetUserBaseInfo(header.UserId, header.CompanyId); err != nil {
|
|
|
1668
|
+ log.Error(err)
|
|
|
1669
|
+ return
|
|
|
1670
|
+ }
|
1667
|
for i := 0; i < len(myChances); i++ {
|
1671
|
for i := 0; i < len(myChances); i++ {
|
1668
|
chance := myChances[i]
|
1672
|
chance := myChances[i]
|
1669
|
commItem := &protocol.CommonListItem{}
|
1673
|
commItem := &protocol.CommonListItem{}
|
|
@@ -1678,41 +1682,19 @@ func MyComment(header *protocol.RequestHeader, request *protocol.MyCommentReques |
|
@@ -1678,41 +1682,19 @@ func MyComment(header *protocol.RequestHeader, request *protocol.MyCommentReques |
1678
|
if chance.Status == models.ChanceStatusClose { //机会关闭
|
1682
|
if chance.Status == models.ChanceStatusClose { //机会关闭
|
1679
|
commItem.ChanceStatus = protocol.ChanceStatusClose
|
1683
|
commItem.ChanceStatus = protocol.ChanceStatusClose
|
1680
|
}
|
1684
|
}
|
1681
|
- if provider, err = agg.GetUserBaseInfo(chance.ChanceUserId, header.CompanyId); err != nil {
|
|
|
1682
|
- commItem.ChanceStatus = protocol.ChanceStatusDelete
|
|
|
1683
|
- err = nil
|
|
|
1684
|
- log.Error(err)
|
|
|
1685
|
- commItem.Chance = protocol.ChanceItem{}
|
|
|
1686
|
- //return
|
|
|
1687
|
- } else {
|
|
|
1688
|
- item := protocol.ChanceItem{
|
|
|
1689
|
- Id: chance.SourceId,
|
|
|
1690
|
- Provider: provider,
|
|
|
1691
|
- CreateTime: chance.CreateTime.Unix() * 1000,
|
|
|
1692
|
- PublicStatus: chance.PublishStatus,
|
|
|
1693
|
- }
|
|
|
1694
|
- jsonUnmarshal(chance.SourceContent, &item.FormList)
|
|
|
1695
|
- item.FormList = clearEmptyForm(item.FormList)
|
|
|
1696
|
- jsonUnmarshal(chance.Images, &item.Pictures)
|
|
|
1697
|
- jsonUnmarshal(chance.Voices, &item.Speechs)
|
|
|
1698
|
- jsonUnmarshal(chance.Videos, &item.Videos)
|
|
|
1699
|
- commItem.Chance = item
|
1685
|
+ item := protocol.ChanceItem{
|
|
|
1686
|
+ Id: chance.SourceId,
|
|
|
1687
|
+ Provider: provider,
|
|
|
1688
|
+ CreateTime: chance.CreateTime.Unix() * 1000,
|
|
|
1689
|
+ PublicStatus: chance.PublishStatus,
|
1700
|
}
|
1690
|
}
|
|
|
1691
|
+ jsonUnmarshal(chance.SourceContent, &item.FormList)
|
|
|
1692
|
+ item.FormList = clearEmptyForm(item.FormList)
|
|
|
1693
|
+ jsonUnmarshal(chance.Images, &item.Pictures)
|
|
|
1694
|
+ jsonUnmarshal(chance.Voices, &item.Speechs)
|
|
|
1695
|
+ jsonUnmarshal(chance.Videos, &item.Videos)
|
|
|
1696
|
+ commItem.Chance = item
|
1701
|
commItem.ReviewStatus = chance.ReviewStatus
|
1697
|
commItem.ReviewStatus = chance.ReviewStatus
|
1702
|
- //{
|
|
|
1703
|
- // var chanceData = protocol.ChanceData{
|
|
|
1704
|
- // ThumbsUpTotal: chance.ZanTotal,
|
|
|
1705
|
- // CommentTotal: chance.CommentTotal,
|
|
|
1706
|
- // PageViewTotal: chance.ViewTotal,
|
|
|
1707
|
- // }
|
|
|
1708
|
- // chanceData.IsThumbsUp, chanceData.IsCollect, _ = getChanceMarkFlag(header, chance.SourceType)
|
|
|
1709
|
- // commItem.ChanceData = chanceData
|
|
|
1710
|
- //}
|
|
|
1711
|
- //{
|
|
|
1712
|
- // //做一次查询 查回所有的模板数据
|
|
|
1713
|
- // commItem.ChanceTemplate = getTemplate(chance.TemplateId)
|
|
|
1714
|
- // commItem.ChanceType = getChanceType(chance.ChanceTypeId)
|
|
|
1715
|
- //}
|
|
|
1716
|
}
|
1698
|
}
|
1717
|
if chance.SourceType == protocol.SourceTypeComment {
|
1699
|
if chance.SourceType == protocol.SourceTypeComment {
|
1718
|
commItem.CommentedData = protocol.CommentData{
|
1700
|
commItem.CommentedData = protocol.CommentData{
|
|
@@ -1832,6 +1814,10 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail |
|
@@ -1832,6 +1814,10 @@ func ChanceDetail(header *protocol.RequestHeader, request *protocol.ChanceDetail |
1832
|
err = protocol.NewErrWithMessage(5101)
|
1814
|
err = protocol.NewErrWithMessage(5101)
|
1833
|
return
|
1815
|
return
|
1834
|
}
|
1816
|
}
|
|
|
1817
|
+ if chance.Status == models.ChanceStatusClose {
|
|
|
1818
|
+ err = protocol.NewErrWithMessage(5102)
|
|
|
1819
|
+ return
|
|
|
1820
|
+ }
|
1835
|
if chance.ReviewStatus == protocol.ReviewStatusPass {
|
1821
|
if chance.ReviewStatus == protocol.ReviewStatusPass {
|
1836
|
if !utils.ExecuteSqlByRoll(true, agg.GetIncrementSql(table, "view_total", 1, request.Id)) {
|
1822
|
if !utils.ExecuteSqlByRoll(true, agg.GetIncrementSql(table, "view_total", 1, request.Id)) {
|
1837
|
//
|
1823
|
//
|