Commit 50adaeee by mushishixian

起订量小于50的排序问题

parent 6e11526b
Showing with 4 additions and 0 deletions
...@@ -7,6 +7,7 @@ import ( ...@@ -7,6 +7,7 @@ import (
"go_sku_server/model" "go_sku_server/model"
c "go_sku_server/pkg/common" c "go_sku_server/pkg/common"
"go_sku_server/pkg/gredis" "go_sku_server/pkg/gredis"
"sort"
"strconv" "strconv"
) )
...@@ -86,6 +87,9 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) (generatedLadderPri ...@@ -86,6 +87,9 @@ func (ps *PriceService) GenerateLadderPrice(sku model.LySku) (generatedLadderPri
PriceUs: c.MyRound(c.MulFloat(costPriceUs, ratio), 4), PriceUs: c.MyRound(c.MulFloat(costPriceUs, ratio), 4),
}) })
} }
sort.Slice(generatedLadderPrice, func(i, j int) bool {
return generatedLadderPrice[i].Purchases < generatedLadderPrice[j].Purchases
})
return generatedLadderPrice return generatedLadderPrice
} }
//判断最小起订量是属于哪个范围 //判断最小起订量是属于哪个范围
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment