From d2ebddf88c9c6bd0e3c8a5db0afdf91038a5e3ec Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Sun, 8 Oct 2023 16:22:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/caravan/module.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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)))