From 17ae45e74c3030d938444ad057b87c02a344f3d5 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Fri, 7 May 2021 11:40:23 +0800 Subject: [PATCH] aa --- business/jxstore/partner/mt/union.go | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) 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) }