This commit is contained in:
邹宗楠
2024-10-10 09:06:39 +08:00
parent 64064afc0e
commit 8ad9d064e3

View File

@@ -3734,10 +3734,14 @@ func GetTopSkusByStoreIDs(ctx *jxcontext.Context, storeIDs []int) (storeSkuNameE
if len(storeIDs) == 0 {
return storeSkuNameExt2, err
}
globals.SugarLogger.Debugf("---storeIds := %s", utils.Format4Output(storeIDs, false))
storeSkuNameExt, err := dao.GetTopSkusByStoreIDs(db, storeIDs)
if err != nil {
return nil, err
}
for _, v := range storeSkuNameExt {
globals.SugarLogger.Debugf("----------------storeSkuNameExtv := %d,%d", v.StoreID, v.SkuID)
}
for _, v := range storeSkuNameExt {
if skuMap[v.SkuID] == nil {
@@ -3749,7 +3753,6 @@ func GetTopSkusByStoreIDs(ctx *jxcontext.Context, storeIDs []int) (storeSkuNameE
for _, v := range skuMap {
storeSkuNameExt2 = append(storeSkuNameExt2, v)
}
globals.SugarLogger.Debugf("----------storeSkuNameExt2:%s", utils.Format4Output(storeSkuNameExt2, false))
for i := 0; i < len(storeSkuNameExt2)-1; i++ {
for j := 0; j < len(storeSkuNameExt2)-i-1; j++ {
if storeSkuNameExt2[j].Count < storeSkuNameExt2[j+1].Count {
@@ -3759,7 +3762,10 @@ func GetTopSkusByStoreIDs(ctx *jxcontext.Context, storeIDs []int) (storeSkuNameE
}
}
}
globals.SugarLogger.Debugf("----------storeSkuNameExt255:%s", utils.Format4Output(storeSkuNameExt2, false))
for _, v := range storeSkuNameExt2 {
globals.SugarLogger.Debugf("---------------- storeSkuNameExt 2 v := %d,%d", v.StoreID, v.SkuID)
}
return storeSkuNameExt2, err
}