Commit 6d7b368c by mushishixian

阶梯价问题

parent f69088f7
Showing with 5 additions and 4 deletions
......@@ -201,10 +201,11 @@ func MatchGoodsInfo(goods model.ApiGoods, goodsMap GoodsMap) (bomMatching model.
bomMatching.LadderPrice = string(ladderPriceStr)
//获取美元和人民币的价格(需要去判断数量)
var ladder model.LadderPrice
for _, price := range goods.LadderPrice {
for key, price := range goods.LadderPrice {
//需要用于获取价格的阶梯价
if bomMatching.Number <= price.Purchases {
ladder = price
if bomMatching.Number < price.Purchases {
//ladder = price
ladder = goods.LadderPrice[key-1]
break
}
}
......@@ -227,7 +228,7 @@ func MatchGoodsInfo(goods model.ApiGoods, goodsMap GoodsMap) (bomMatching model.
return
}
func UpdateGoodsPriceAndStockQueue(goodsName string){
func UpdateGoodsPriceAndStockQueue(goodsName string) {
queueExchange := rabbitmq.QueueExchange{
"keyword_search_queue",
"",
......
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