|
@@ -135,6 +135,7 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest) |
|
@@ -135,6 +135,7 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest) |
|
135
|
baseUserInfo *protocol.BaseUserInfo
|
135
|
baseUserInfo *protocol.BaseUserInfo
|
|
136
|
total int
|
136
|
total int
|
|
137
|
exists bool
|
137
|
exists bool
|
|
|
|
138
|
+ commentIds []int64
|
|
138
|
)
|
139
|
)
|
|
139
|
if comments, total, err = models.GetComments(0, request.SourceType, request.SourceId, request.LastId, request.PageSize); err != nil {
|
140
|
if comments, total, err = models.GetComments(0, request.SourceType, request.SourceId, request.LastId, request.PageSize); err != nil {
|
|
140
|
log.Error(err)
|
141
|
log.Error(err)
|
|
@@ -163,8 +164,14 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest) |
|
@@ -163,8 +164,14 @@ func Comments(header *protocol.RequestHeader, request *protocol.CommentsRequest) |
|
163
|
if exists, _ = models.ExitsChanceFavorite(header.UserId, header.CompanyId, comment.Id, protocol.MarkFlagZan); exists {
|
164
|
if exists, _ = models.ExitsChanceFavorite(header.UserId, header.CompanyId, comment.Id, protocol.MarkFlagZan); exists {
|
|
164
|
item.IsZan = true
|
165
|
item.IsZan = true
|
|
165
|
}
|
166
|
}
|
|
|
|
167
|
+ commentIds = append(commentIds, comment.Id)
|
|
166
|
rsp.Comments = append(rsp.Comments, item)
|
168
|
rsp.Comments = append(rsp.Comments, item)
|
|
167
|
}
|
169
|
}
|
|
|
|
170
|
+ if len(commentIds) > 0 {
|
|
|
|
171
|
+ if !utils.ExecuteSqlByRoll(true, agg.GetIncrementSqlBatch("comment", "view_total", 1, commentIds...)) {
|
|
|
|
172
|
+ //
|
|
|
|
173
|
+ }
|
|
|
|
174
|
+ }
|
|
168
|
return
|
175
|
return
|
|
169
|
}
|
176
|
}
|
|
170
|
|
177
|
|