修改微盟回调的bug

This commit is contained in:
gazebo
2019-10-31 14:06:14 +08:00
parent 5dc67bcd9e
commit ae58b41ac6
2 changed files with 8 additions and 2 deletions

View File

@@ -26,11 +26,14 @@ func OnCallbackMsg(msg *weimobapi.CallbackMsg) (response *weimobapi.CallbackResp
}
func onOrderMsg(msg *weimobapi.CallbackMsg) (response *weimobapi.CallbackResponse) {
globals.SugarLogger.Debugf("onOrderMsg:%s", utils.Format4Output(msg, true))
if msg.Event == weimobapi.MsgEventOrderStatusChange {
if orderDetail, err := api.WeimobAPI.QueryOrderDetail2(msg.OrderNo, false); err == nil {
if orderDetail.OrderStatus == weimobapi.OrderStatusFinished && orderDetail.PaymentAmount >= minCSOrderPayment {
changeStoreSkusByOrder(orderDetail)
}
} else {
response = weimobapi.Err2CallbackResponse(err, "")
}
}
return response
@@ -43,6 +46,7 @@ func changeStoreSkusByOrder(order *weimobapi.OrderDetail) {
if len(storeList) == 1 {
var skuBindInfos []*cms.StoreSkuBindInfo
storeID := storeList[0].ID
globals.SugarLogger.Debugf("changeStoreSkusByOrder storeID:%d", storeID)
for _, v := range order.ItemList {
nameID := int(utils.Str2Int64WithDefault(v.SkuCode, 0))
unitPrice := v.OriginalPrice