diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index e0623ffd8..dda3dc658 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -3734,15 +3734,18 @@ func GetTopSkusByStoreIDs(ctx *jxcontext.Context, storeIDs []int) (storeSkuNameE if len(storeIDs) == 0 { return storeSkuNameExt2, err } + beginTime := time.Now() storeSkuNameExt, err := dao.GetTopSkusByStoreIDs(db, storeIDs) if err != nil { return nil, err } + usedMilliSecond := time.Now().Sub(beginTime) / time.Millisecond + baseapi.SugarLogger.Infof("GetTopSkusByStoreIDs usedMilliSecond------1:%d", usedMilliSecond) + for _, v := range storeSkuNameExt { if skuMap[v.SkuID] == nil { skuMap[v.SkuID] = v - } - if skuMap[v.SkuID] != nil && v.Count != 0 { + } else if skuMap[v.SkuID] != nil && v.Count != 0 { skuMap[v.SkuID] = v } } @@ -3758,6 +3761,7 @@ func GetTopSkusByStoreIDs(ctx *jxcontext.Context, storeIDs []int) (storeSkuNameE } } } + baseapi.SugarLogger.Infof("GetTopSkusByStoreIDs usedMilliSecond------2:%d", time.Now().Sub(beginTime)/time.Millisecond) return storeSkuNameExt2, err }