This commit is contained in:
邹宗楠
2024-10-09 11:15:55 +08:00
parent 4f34f09962
commit 7d5e9a86b5

View File

@@ -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
}