From d7344970fb0458040338c8a0a565b773d82b5c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 9 Sep 2020 10:58:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=95=86=E5=9F=8E=E5=87=BA?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/model/dao/dao_order.go | 2 +- business/partner/purchase/jdshop/callback.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/business/model/dao/dao_order.go b/business/model/dao/dao_order.go index 94d73f4a9..15eb63040 100644 --- a/business/model/dao/dao_order.go +++ b/business/model/dao/dao_order.go @@ -787,7 +787,7 @@ func GetOrders(db *DaoDB, ids []int64, isIncludeSku, isIncludeFake bool, fromDat } sql += ` FROM goods_order t1 - LEFT JOIN waybill t2 ON t1.vendor_waybill_id = t2.vendor_waybill_id AND t1.waybill_vendor_id = t2.waybill_vendor_id + LEFT JOIN waybill t2 ON t1.vendor_waybill_id = t2.vendor_waybill_id AND t1.waybill_vendor_id = t2.waybill_vendor_id AND t1.vendor_order_id = t2.vendor_order_id LEFT JOIN store t5 ON t5.id = IF(t1.jx_store_id <> 0, t1.jx_store_id, t1.store_id) LEFT JOIN place city ON city.code = t5.city_code LEFT JOIN place district ON district.code = t5.district_code` diff --git a/business/partner/purchase/jdshop/callback.go b/business/partner/purchase/jdshop/callback.go index 810aa72f6..d4eaaecc7 100644 --- a/business/partner/purchase/jdshop/callback.go +++ b/business/partner/purchase/jdshop/callback.go @@ -47,8 +47,12 @@ func OnCallbackMsg(msg *jdshopapi.CallBackResult) (err error) { if order != nil { if order.ActualPayPrice == 0 { if jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment)) == 0 { - + order.ActualPayPrice = jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderTotalPrice) + utils.Str2Float64(msg.FreightPrice) - utils.Str2Float64(msg.SellerDiscount)) + } else { + order.ActualPayPrice = jxutils.StandardPrice2Int(utils.Str2Float64(msg.OrderPayment)) } + order.TotalShopMoney = utils.Float64TwoInt64(float64(order.ActualPayPrice) * jdshopapi.JdsPayPercentage) + partner.CurOrderManager.UpdateOrderFields(order, []string{"ActualPayPrice", "TotalShopMoney"}) } } })