1
This commit is contained in:
@@ -664,9 +664,21 @@ func (c *PurchaseHandler) CancelOrder(ctx *jxcontext.Context, order *model.Goods
|
|||||||
for _, v := range order.Skus {
|
for _, v := range order.Skus {
|
||||||
count += v.Count
|
count += v.Count
|
||||||
}
|
}
|
||||||
if _, err = getAPI(order.VendorOrgCode, 0, "").ApplyMarketAfterSale(utils.Str2Int64(order.VendorOrderID), int64(count), 3); err == nil {
|
api := getAPI(order.VendorOrgCode, 0, "")
|
||||||
// 调用开放平台接口取消订单,不推送取消订单消息和退款消息。
|
// 获取订单详情
|
||||||
c.postFakeMsg(order.VendorOrderID, tiktokShop.CallbackCancelOrderMsgTagId, utils.Int2Str(tiktokShop.CreateOrderStatusCancel), order.VendorOrgCode)
|
orderDetail, err := api.GetTiktokOrderDetail(order.VendorOrderID)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, v := range orderDetail.SkuOrderList {
|
||||||
|
_, err = api.ApplyMarketAfterSale(utils.Str2Int64(v.OrderId), v.ItemNum, 3)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 调用开放平台接口取消订单,不推送取消订单消息和退款消息。
|
||||||
|
c.postFakeMsg(order.VendorOrderID, tiktokShop.CallbackCancelOrderMsgTagId, utils.Int2Str(tiktokShop.CreateOrderStatusCancel), order.VendorOrgCode)
|
||||||
|
if err != nil {
|
||||||
|
return errors.New(err.Error() + "-" + "系统退单错误请多次退单/联系管理员/前往抖店平台退单")
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user