- add debug msg for onOrderComment.

This commit is contained in:
gazebo
2018-10-09 10:58:49 +08:00
parent 7f2d829914
commit 29f82c01b5

View File

@@ -69,7 +69,7 @@ var (
)
func (c *PurchaseHandler) onOrderComment(msg *jdapi.CallbackOrderMsg) (err error) {
globals.SugarLogger.Debugf("onOrderComment msg:%s", utils.Format4Output(msg, true))
globals.SugarLogger.Debugf("onOrderComment orderID:%s", msg.BillID)
go func() error {
intOrderID := utils.Str2Int64(msg.BillID)
result, err := api.JdAPI.GetCommentByOrderId(intOrderID)
@@ -85,7 +85,7 @@ func (c *PurchaseHandler) onOrderComment(msg *jdapi.CallbackOrderMsg) (err error
isNewComment := false
if err == orm.ErrNoRows {
isNewComment = true
err = c.replyOrderComment(intOrderID, utils.Int64ToStr(utils.MustInterface2Int64(result["storeId"])), score)
c.replyOrderComment(intOrderID, utils.Int64ToStr(utils.MustInterface2Int64(result["storeId"])), score)
}
if score <= JX_BAD_COMMENTS_MAX_LEVEL || !isNewComment { // 如果是直接非差评,忽略
comment.Createtime = utils.Timestamp2Str(utils.MustInterface2Int64(result["createTime"].(map[string]interface{})["time"]) / 1000)
@@ -130,7 +130,7 @@ func (c *PurchaseHandler) onOrderComment(msg *jdapi.CallbackOrderMsg) (err error
}
}
if err != nil {
globals.SugarLogger.Warnf("onOrderComment failed with error:%v", err)
globals.SugarLogger.Warnf("onOrderComment orderID:%s failed with error:%v", msg.BillID, err)
}
return err
}()