From ca9827db162c6bd555201e96f761aec9973fad7e Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 25 Jul 2024 14:03:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E5=85=85=E6=94=AF=E6=8C=81=E9=81=93?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/shopmgr.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/worldsrv/shopmgr.go b/worldsrv/shopmgr.go index f6f2d2a..e0ab93d 100644 --- a/worldsrv/shopmgr.go +++ b/worldsrv/shopmgr.go @@ -1239,18 +1239,24 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any, return webapi.API_CreateOrder(common.GetAppId(), dbShop.LogId.Hex(), ConfigPayId, p.SnId, 0, p.Platform, p.PackageID, p.DeviceOS, p.DeviceId, bbd.Name, amount, int32(bbd.Price2), nil, "", p.Channel, p.ChannelId) } else if wfs, ok := data.(*webapi_proto.WelfareSpree); ok { + var items []model.ItemInfo for _, it := range wfs.Item { if it.Type == 1 { amount[0] = it.Grade } else if it.Type == 2 { amount[1] = it.Grade + } else if it.Type == 3 { + items = append(items, model.ItemInfo{ + ItemId: it.Item_Id, + ItemNum: int64(it.Grade), + }) } } var gainWay int32 = common.GainWay_ActFirstPay if remark == "ContinuousPay" { gainWay = common.GainWay_ActContinuousPay } - dbShop = this.NewDbShop(p, 0, amount[:], ShopConsumeMoney, int32(wfs.Price2), gainWay, nil, 0, "", 0, remark, []int32{wfs.Day}) + dbShop = this.NewDbShop(p, 0, amount[:], ShopConsumeMoney, int32(wfs.Price2), gainWay, items, 0, "", 0, remark, []int32{wfs.Day}) err := model.InsertDbShopLog(dbShop) if err != nil { logger.Logger.Errorf("model.InsertDbShopLog err:", err)