From 611783af0ff270e7f1ad0bc0b7356b90af42063b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 3 Jul 2023 14:45:49 +0800 Subject: [PATCH] 1 --- .../purchase/tao_vegetable/financial.go | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/business/partner/purchase/tao_vegetable/financial.go b/business/partner/purchase/tao_vegetable/financial.go index 0137e670e..bc5389968 100644 --- a/business/partner/purchase/tao_vegetable/financial.go +++ b/business/partner/purchase/tao_vegetable/financial.go @@ -177,24 +177,26 @@ func (p *PurchaseHandler) OrderDetail2Financial(result *domain591.AlibabaAelophy orderFinancial.SkuBoxMoney += orderSkuFinancial.SkuBoxMoney // 活动 - for _, v := range *x.Activitys { - activity := &model.OrderDiscountFinancial{ - VendorID: orderFinancial.VendorID, - VendorOrderID: orderFinancial.VendorOrderID, + if x.Activitys != nil { + for _, v := range *x.Activitys { + activity := &model.OrderDiscountFinancial{ + VendorID: orderFinancial.VendorID, + VendorOrderID: orderFinancial.VendorOrderID, + } + if v.ChannelActivityId != nil { + activity.VendorActivityID = *v.ChannelActivityId + activity.Type = tao_vegetable.ActivityTypeChannel + } + if v.BizActivityId != nil { + activity.VendorActivityID = *v.BizActivityId + activity.Type = tao_vegetable.ActivityTypeBiz + } + if v.MerchantActivityId != nil { + activity.VendorActivityID = *v.MerchantActivityId + activity.Type = tao_vegetable.ActivityTypeMerchant + } + orderFinancial.Discounts = append(orderFinancial.Discounts, activity) } - if v.ChannelActivityId != nil { - activity.VendorActivityID = *v.ChannelActivityId - activity.Type = tao_vegetable.ActivityTypeChannel - } - if v.BizActivityId != nil { - activity.VendorActivityID = *v.BizActivityId - activity.Type = tao_vegetable.ActivityTypeBiz - } - if v.MerchantActivityId != nil { - activity.VendorActivityID = *v.MerchantActivityId - activity.Type = tao_vegetable.ActivityTypeMerchant - } - orderFinancial.Discounts = append(orderFinancial.Discounts, activity) } }