尝试做list排序,GetTopSkusByStoreIDs
This commit is contained in:
@@ -2337,6 +2337,15 @@ func GetTopSkusByStoreIDs(ctx *jxcontext.Context, storeIDs []int) (storeSkuNameE
|
||||
for _, v := range skuMap {
|
||||
storeSkuNameExt2 = append(storeSkuNameExt2, v)
|
||||
}
|
||||
for i := 0; i < len(storeSkuNameExt2)-1; i++ {
|
||||
for j := 0; j < len(storeSkuNameExt2)-i-1; j++ {
|
||||
if storeSkuNameExt2[i].Count < storeSkuNameExt2[i+1].Count {
|
||||
tmp := storeSkuNameExt2[i]
|
||||
storeSkuNameExt2[i] = storeSkuNameExt2[i+1]
|
||||
storeSkuNameExt2[i+1] = tmp
|
||||
}
|
||||
}
|
||||
}
|
||||
return storeSkuNameExt2, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user