From ab98c19187a0ebc885e7abe4a6ccc60deca0ead0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Tue, 17 Nov 2020 17:37:03 +0800 Subject: [PATCH] cao --- business/partner/purchase/jdshop/callback.go | 26 ++++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/business/partner/purchase/jdshop/callback.go b/business/partner/purchase/jdshop/callback.go index f0ace94ea..62fa95d5a 100644 --- a/business/partner/purchase/jdshop/callback.go +++ b/business/partner/purchase/jdshop/callback.go @@ -103,14 +103,24 @@ func result2Orders(msg *jdshopapi.CallBackResult) (order *model.GoodsOrder, err OrderCreatedAt: utils.Str2Time(msg.OrderStartTime), ConsigneeAddress: Decrypt(msg.ConsigneeInfo.FullAddress), ConsigneeName: Decrypt(msg.ConsigneeInfo.Fullname), - ConsigneeMobile: Decrypt(msg.ConsigneeInfo.Mobile), - ConsigneeMobile2: Decrypt(msg.ConsigneeInfo.Telephone), - ActualPayPrice: jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment)), - Status: model.OrderStatusNew, - TotalShopMoney: utils.Float64TwoInt64(math.Round(float64(jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment))) * jdshopapi.JdsPayPercentage)), - DeliveryType: model.OrderDeliveryTypeStoreSelf, - StatusTime: utils.Str2Time(msg.OrderStartTime), - OrderSeq: 0, + // ConsigneeMobile: Decrypt(msg.ConsigneeInfo.Mobile), + // ConsigneeMobile2: Decrypt(msg.ConsigneeInfo.Telephone), + ActualPayPrice: jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment)), + Status: model.OrderStatusNew, + TotalShopMoney: utils.Float64TwoInt64(math.Round(float64(jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment))) * jdshopapi.JdsPayPercentage)), + DeliveryType: model.OrderDeliveryTypeStoreSelf, + StatusTime: utils.Str2Time(msg.OrderStartTime), + OrderSeq: 0, + } + if len(msg.ConsigneeInfo.Mobile) != 11 { + order.ConsigneeMobile = Decrypt(msg.ConsigneeInfo.Mobile) + } else { + order.ConsigneeMobile = msg.ConsigneeInfo.Mobile + } + if len(msg.ConsigneeInfo.Telephone) != 11 { + order.ConsigneeMobile2 = Decrypt(msg.ConsigneeInfo.Telephone) + } else { + order.ConsigneeMobile2 = msg.ConsigneeInfo.Telephone } if order.TotalShopMoney < 100 { order.TotalShopMoney = 100