diff --git a/business/jxstore/partner/mt/union.go b/business/jxstore/partner/mt/union.go index 8aa8de44e..bd2b9dc8f 100644 --- a/business/jxstore/partner/mt/union.go +++ b/business/jxstore/partner/mt/union.go @@ -106,18 +106,22 @@ func OnCallback(call *mtunionapi.CallBackResult) (err error) { } else { //new unionOrder := &model.UnionOrder{ - VendorOrderID: order.Order.Orderid, - VendorID: model.VendorIDMTWM, - Status: mtunionOrderStatus2Jx(order.Order.Status), - PID: order.Order.Sid, - PayPrice: int(jxutils.StandardPrice2Int(utils.Str2Float64(order.Order.Direct))), - PromotionAmount: int(jxutils.StandardPrice2Int(utils.Str2Float64(order.Coupon[0].Profit))), - GoodsName: order.Order.Smstitle, - GoodsID: order.Order.Dealid, - OrderCreateAt: time.Unix(utils.Str2Int64(order.Order.Paytime), 0), - OrderPayAt: time.Unix(utils.Str2Int64(order.Order.Paytime), 0), - OrderReceiveAt: time.Unix(utils.Str2Int64(order.Order.Modtime), 0), - OrderSettleAt: time.Unix(utils.Str2Int64(order.Coupon[0].Usetime), 0), + VendorOrderID: order.Order.Orderid, + VendorID: model.VendorIDMTWM, + Status: mtunionOrderStatus2Jx(order.Order.Status), + PID: order.Order.Sid, + PayPrice: int(jxutils.StandardPrice2Int(utils.Str2Float64(order.Order.Direct))), + //PromotionAmount: int(jxutils.StandardPrice2Int(utils.Str2Float64(order.Coupon[0].Profit))), + GoodsName: order.Order.Smstitle, + GoodsID: order.Order.Dealid, + OrderCreateAt: time.Unix(utils.Str2Int64(order.Order.Paytime), 0), + OrderPayAt: time.Unix(utils.Str2Int64(order.Order.Paytime), 0), + OrderReceiveAt: time.Unix(utils.Str2Int64(order.Order.Modtime), 0), + //OrderSettleAt: time.Unix(utils.Str2Int64(order.Coupon[0].Usetime), 0), + } + if len(order.Coupon) > 0 { + unionOrder.PromotionAmount = int(jxutils.StandardPrice2Int(utils.Str2Float64(order.Coupon[0].Profit))) + unionOrder.OrderSettleAt = time.Unix(utils.Str2Int64(order.Coupon[0].Usetime), 0) } cms.NewUnionOrder(unionOrder, orderStatus) }