首充支持道具

This commit is contained in:
sk 2024-07-25 14:03:44 +08:00
parent 675a1cb078
commit ca9827db16
1 changed files with 7 additions and 1 deletions

View File

@ -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)