优化OnOrderComments

This commit is contained in:
gazebo
2019-10-10 16:22:58 +08:00
parent 90bffc3757
commit fe35951287
2 changed files with 31 additions and 35 deletions

View File

@@ -86,8 +86,7 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (
c.replyOrderComment(orderComment)
}
}
if orderComment.Score <= JX_BAD_COMMENTS_MAX_LEVEL || !isNewComment { // 如果是直接非差评,忽略
if isNewComment || orderComment.Score <= JX_BAD_COMMENTS_MAX_LEVEL {
if isNewComment && orderComment.Score <= JX_BAD_COMMENTS_MAX_LEVEL || !isNewComment && orderComment.Score > JX_BAD_COMMENTS_MAX_LEVEL { // 如果是直接非差评,或补评仍然是差评,忽略
if isNewComment {
comment2.Createtime = utils.Time2Str(orderComment.CommentCreatedAt)
comment2.Msg = orderComment.OriginalMsg
@@ -121,9 +120,6 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (
weixinmsg.PushJDBadCommentToWeiXin(comment2)
}
}
} else { // 修改评价但是仍然低于或等于JX_BAD_COMMENTS_MAX_LEVEL
comment2 = nil
}
} else { // 修改评价高于JX_BAD_COMMENTS_MAX_LEVEL
if orderComment.CommentCreatedAt.Sub(str2Time(comment2.Createtime)) == 0 ||
orderComment.CommentCreatedAt.Sub(str2Time(comment2.Updatetime)) == 0 {

View File

@@ -16,7 +16,7 @@ import (
// 饿百的评价不是一点一点出来的,而是一下把前一天的全部崩出来。。。
const (
RefreshCommentTime = 36 * time.Hour
RefreshCommentTime = 84 * time.Hour
RefreshCommentTimeInterval = 60 * time.Minute
EBAI_BAD_COMMENTS_MAX_MODIFY_TIME = 24 // 小时
)