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 }