From 5a7ac24c3ca6aa86a3e59c40d2d93ca972cc3d0f Mon Sep 17 00:00:00 2001 From: gazebo Date: Tue, 15 Oct 2019 15:17:43 +0800 Subject: [PATCH] up --- business/partner/purchase/jd/store.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/business/partner/purchase/jd/store.go b/business/partner/purchase/jd/store.go index d90bc6c9d..9c1995b3c 100644 --- a/business/partner/purchase/jd/store.go +++ b/business/partner/purchase/jd/store.go @@ -172,18 +172,20 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin StationNo: store.VendorStoreID, UserPin: userName, OpenDistanceFreight: true, - IsFullFree: len(storeDetail.FreightDeductionPackObj.FreightDeductionList) > 0, StartCharge: int64(storeDetail.FreightDeductionPackObj.StartPrice), } - if freightParams.IsFullFree { + if len(storeDetail.FreightDeductionPackObj.FreightDeductionList) > 0 { for _, v := range storeDetail.FreightDeductionPackObj.FreightDeductionList { - freightParams.FreeFreightInfoList = append(freightParams.FreeFreightInfoList, &jdapi.FreeFreightInfo{ - FullFreeMoney: int64(v.BeginPrice), - FreeType: jdapi.FreightFreeTypePartBase, - FreeMoney: int64(v.DeductFreight), - }) + if v.DeductFreight > 0 { + freightParams.FreeFreightInfoList = append(freightParams.FreeFreightInfoList, &jdapi.FreeFreightInfo{ + FullFreeMoney: int64(v.BeginPrice), + FreeType: jdapi.FreightFreeTypePartBase, + FreeMoney: int64(v.DeductFreight), + }) + } } } + freightParams.IsFullFree = len(freightParams.FreeFreightInfoList) > 0 globals.SugarLogger.Debug(utils.Format4Output(freightParams, false)) if globals.EnableJdStoreWrite { err = getAPI("").UpdateStoreFreightConfigNew(freightParams)