Compare commits

..

No commits in common. "d292cbc11826d61063e83c643dbe219820348d99" and "d2c5c4f1599d81ad5832931912b4416225a7ea52" have entirely different histories.

2 changed files with 17 additions and 17 deletions

View File

@ -34,7 +34,7 @@ const (
type ShopInfo struct { type ShopInfo struct {
Id int32 // 商品ID Id int32 // 商品ID
Page int32 // 页面 1金币页面 2钻石页面 3道具页面 4,房卡 Page int32 // 页面 1金币页面 2钻石页面 3道具页面
Order int32 // 排序 页面内商品的位置排序 Order int32 // 排序 页面内商品的位置排序
Location []int32 // 显示位置 第1位竖版大厅 第2位Tienlen1级选场 第3位捕鱼1级选场 Location []int32 // 显示位置 第1位竖版大厅 第2位Tienlen1级选场 第3位捕鱼1级选场
Picture string // 图片id Picture string // 图片id
@ -44,7 +44,7 @@ type ShopInfo struct {
AdTime int32 // 观看几次广告 AdTime int32 // 观看几次广告
RepeatTimes int32 // 领取次数 RepeatTimes int32 // 领取次数
CoolingTime []int32 // 观看冷却时间 CoolingTime []int32 // 观看冷却时间
Type int32 // 获得类型 1金币 2钻石 3道具类型 4房卡 Type int32 // 获得类型 1金币 2钻石 3道具类型
Amount int64 // 获得数量 Amount int64 // 获得数量
AddArea []int32 // 加送百分比比如加送10%就配置110 AddArea []int32 // 加送百分比比如加送10%就配置110
ItemId int32 // 获得道具ID ItemId int32 // 获得道具ID

View File

@ -63,8 +63,6 @@ const (
ShopTypeCoin = iota + 1 // 金币 ShopTypeCoin = iota + 1 // 金币
ShopTypeDiamond // 钻石 ShopTypeDiamond // 钻石
ShopTypeItem // 道具 ShopTypeItem // 道具
ShopTypeFangKa // 房卡
ShopTypeMax
) )
// 兑换商品状态 // 兑换商品状态
@ -541,10 +539,10 @@ func (this *ShopMgr) shopAddItem(p *Player, shopInfo *model.ShopInfo, vipShopId
// createOrder 保存购买记录 // createOrder 保存购买记录
func (this *ShopMgr) createOrder(p *Player, shopInfo *model.ShopInfo, costNum int64, amount [3]int32) { func (this *ShopMgr) createOrder(p *Player, shopInfo *model.ShopInfo, costNum int64, amount [3]int32) {
//if shopInfo.Type < ShopTypeCoin && shopInfo.Type >= ShopTypeMax { if shopInfo.Type < ShopTypeCoin && shopInfo.Type > ShopTypeItem {
// logger.Logger.Errorf("createOrder err: type = %v", shopInfo.Type) logger.Logger.Errorf("createOrder err: type = %v", shopInfo.Type)
// return return
//} }
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} { task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
dbShop := model.NewDbShop(p.Platform, shopInfo.Page, amount[:], "sys", 0, shopInfo.ConstType, int32(costNum), dbShop := model.NewDbShop(p.Platform, shopInfo.Page, amount[:], "sys", 0, shopInfo.ConstType, int32(costNum),
@ -1230,15 +1228,17 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
amount[ShopTypeDiamond-1] = int32(addTotal) amount[ShopTypeDiamond-1] = int32(addTotal)
var itemInfo []model.ItemInfo var itemInfo []model.ItemInfo
var webItemInfo []*webapi_proto.ItemInfo var webItemInfo []*webapi_proto.ItemInfo
for _, info := range shopInfo.GetItems() { if shopInfo.AddItemInfo != nil {
itemInfo = append(itemInfo, model.ItemInfo{ for _, info := range shopInfo.AddItemInfo {
ItemId: info.ItemId, itemInfo = append(itemInfo, model.ItemInfo{
ItemNum: info.ItemNum, ItemId: info.ItemId,
}) ItemNum: int64(info.ItemNum),
webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{ })
ItemId: info.ItemId, webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{
ItemNum: info.ItemNum, ItemId: info.ItemId,
}) ItemNum: info.ItemNum,
})
}
} }
dbShop = this.NewDbShop(p, shopInfo.Page, amount[:], ShopConsumeMoney, costNum, dbShop = this.NewDbShop(p, shopInfo.Page, amount[:], ShopConsumeMoney, costNum,