From 296d877d550d767e00a1d22b043accf00133b6c2 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, 8 Jan 2020 10:20:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=85=B3=E6=B3=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/store_sku.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 772e849a5..bbaeb71cf 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -2872,6 +2872,7 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync, } for k, v := range skuNameMap { skuBindInfo := &StoreSkuBindInfo{ + StoreID: store.ID, NameID: k, UnitPrice: v, IsFocus: 1, @@ -2893,7 +2894,7 @@ func FocusStoreSkusByExcelBin(ctx *jxcontext.Context, reader io.Reader, isAsync, case 2: for _, v := range result1 { tUpdate := v.(*tUpdateStoresSkus) - UpdateStoresSkus(ctx, []int{tUpdate.StoreID}, tUpdate.SkuBindInfos, false, isAsync, isContinueWhenError) + UpdateStoresSkusByBind(ctx, tUpdate.SkuBindInfos, true, true) } } return result, err @@ -3048,12 +3049,13 @@ func AutoFocusStoreSkusWithoutFocusForTopSkus(ctx *jxcontext.Context) (err error payPercentage = v.PayPercentage } if len(skuNameAndPlaceList) > 0 { - for _, v := range skuNameAndPlaceList { - if skuNameMap[v.ID] != 0 { - priceReferList, err := dao.GetPriceReferSnapshotNoPage(db, []int{v.CityCode}, nil, []int{v.ID}, utils.Time2Date(time.Now().AddDate(0, 0, -1))) + for _, vv := range skuNameAndPlaceList { + if skuNameMap[vv.ID] != 0 { + priceReferList, err := dao.GetPriceReferSnapshotNoPage(db, []int{vv.CityCode}, nil, []int{vv.ID}, utils.Time2Date(time.Now().AddDate(0, 0, -1))) if err == nil && len(priceReferList) > 0 { storeSkuBindInfo := &StoreSkuBindInfo{ - NameID: v.ID, + StoreID: v.ID, + NameID: vv.ID, UnitPrice: priceReferList[0].MidUnitPrice * payPercentage / 100, IsFocus: 1, IsSale: 0, @@ -3063,7 +3065,7 @@ func AutoFocusStoreSkusWithoutFocusForTopSkus(ctx *jxcontext.Context) (err error } } } - UpdateStoreSkus(ctx, v.ID, skuBindInfoList, true, true) + UpdateStoresSkusByBind(ctx, skuBindInfoList, true, true) } return err }