diff --git a/modules/caravan/module.go b/modules/caravan/module.go index ca1305478..e6efb1352 100644 --- a/modules/caravan/module.go +++ b/modules/caravan/module.go @@ -149,9 +149,9 @@ func (this *Caravan) InitCaravanItemData(uid string, data *pb.DBCaravan) { goodinfo := &pb.GoodsInfo{ Goods: make(map[string]int32, 0), } - var price int32 - for _, c := range items { + for _, c := range items { + var price int32 if _, ok := data.Period[c.Itemid]; !ok { data.Period[c.Itemid] = &pb.GoodPeriod{} } @@ -189,9 +189,7 @@ func (this *Caravan) InitCaravanItemData(uid string, data *pb.DBCaravan) { } } if len(c.FluctuationRange) == 2 { - if c.Itemid == "21000018" { - c.Itemid = "21000018" - } + p := comm.GetRandNum(c.PriceChangeWeightThree[0], c.PriceChangeWeightThree[1]) if bUp { // 价格上涨 price = int32(math.Floor(float64(price) * (1.0 + float64(p)/1000.0)))