From 5801a0c5e9a6738e5ec2217bd7a0f21a445a05b0 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 13 Mar 2019 14:47:15 +0800 Subject: [PATCH] - fix return value for update store sku apis --- business/jxstore/cms/store_sku.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 40724be37..fff72bae1 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -443,7 +443,7 @@ func UpdateStoresSkus(ctx *jxcontext.Context, storeIDs []int, skuBindInfos []*St db := dao.GetDB() hint, err = CurVendorSync.SyncStoresSkus(ctx, db, nil, storeIDs, skuIDs, isAsync, isContinueWhenError) } - if isAsync { + if num == 0 || !!isAsync { hint = utils.Int64ToStr(num) } return hint, err @@ -724,13 +724,15 @@ func UpdateStoresSkusSale(ctx *jxcontext.Context, storeIDs []int, skuBindSkuInfo } num += int64(len(skuIDs)) } - skuIDs := make([]int, 0) - for _, v := range skuBindSkuInfos { - skuIDs = append(skuIDs, v.SkuID) + if num > 0 { + skuIDs := make([]int, 0) + for _, v := range skuBindSkuInfos { + skuIDs = append(skuIDs, v.SkuID) + } + db := dao.GetDB() + hint, err = CurVendorSync.SyncStoresSkus(ctx, db, nil, storeIDs, skuIDs, isAsync, isContinueWhenError) } - db := dao.GetDB() - hint, err = CurVendorSync.SyncStoresSkus(ctx, db, nil, storeIDs, skuIDs, isAsync, isContinueWhenError) - if isAsync { + if num == 0 || !isAsync { hint = utils.Int64ToStr(num) } return hint, err