- fix bug in OrderManager.OnOrderComments

This commit is contained in:
gazebo
2019-03-13 18:06:29 +08:00
parent 0f7a3ab809
commit 8310a0b2cf
4 changed files with 41 additions and 8 deletions

View File

@@ -71,6 +71,17 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (
db := dao.GetDB()
for _, orderComment := range orderCommentList {
globals.SugarLogger.Debugf("OnOrderComments, orderID:%s", orderComment.VendorOrderID)
var order *model.GoodsOrder
if orderComment.VendorID == model.VendorIDEBAI {
if realVendorID := jxutils.GetPossibleVendorIDFromVendorOrderID(orderComment.VendorOrderID); realVendorID == model.VendorIDELM {
if order, err = partner.CurOrderManager.LoadOrder2(orderComment.VendorOrderID, model.VendorIDEBAI); err == nil {
orderComment.VendorOrderID = order.VendorOrderID
} else {
globals.SugarLogger.Warnf("OnOrderComments, load orderID:%s failed", orderComment.VendorOrderID)
continue
}
}
}
comment2 := &legacymodel.JxBadComments2{
OrderId: orderComment.VendorOrderID,
}
@@ -98,9 +109,10 @@ func (c *OrderManager) OnOrderComments(orderCommentList []*model.OrderComment) (
comment2.LastPushTime = utils.Time2Str(time.Now())
comment2.PushNo = 1
comment2.Maxmodifytime = int(orderComment.ModifyDuration)
order, err2 := partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID, orderComment.VendorID)
if err = err2; err == nil {
if order == nil {
order, err = partner.CurOrderManager.LoadOrder(orderComment.VendorOrderID, orderComment.VendorID)
}
if err == nil {
orderComment.StoreID = jxutils.GetSaleStoreIDFromOrder(order)
if orderComment.StoreID > 0 {
comment2.Jxstoreid = utils.Int2Str(orderComment.StoreID)