Compare commits
2 Commits
d2c5c4f159
...
d292cbc118
Author | SHA1 | Date |
---|---|---|
|
d292cbc118 | |
|
05a54af2db |
|
@ -34,7 +34,7 @@ const (
|
|||
|
||||
type ShopInfo struct {
|
||||
Id int32 // 商品ID
|
||||
Page int32 // 页面 1,金币页面 2,钻石页面 3,道具页面
|
||||
Page int32 // 页面 1,金币页面 2,钻石页面 3,道具页面 4,房卡
|
||||
Order int32 // 排序 页面内商品的位置排序
|
||||
Location []int32 // 显示位置 第1位,竖版大厅 第2位,Tienlen1级选场 第3位,捕鱼1级选场
|
||||
Picture string // 图片id
|
||||
|
@ -44,7 +44,7 @@ type ShopInfo struct {
|
|||
AdTime int32 // 观看几次广告
|
||||
RepeatTimes int32 // 领取次数
|
||||
CoolingTime []int32 // 观看冷却时间
|
||||
Type int32 // 获得类型 1,金币 2,钻石 3,道具类型
|
||||
Type int32 // 获得类型 1,金币 2,钻石 3,道具类型 4,房卡
|
||||
Amount int64 // 获得数量
|
||||
AddArea []int32 // 加送百分比(比如加送10%,就配置110)
|
||||
ItemId int32 // 获得道具ID
|
||||
|
|
|
@ -63,6 +63,8 @@ const (
|
|||
ShopTypeCoin = iota + 1 // 金币
|
||||
ShopTypeDiamond // 钻石
|
||||
ShopTypeItem // 道具
|
||||
ShopTypeFangKa // 房卡
|
||||
ShopTypeMax
|
||||
)
|
||||
|
||||
// 兑换商品状态
|
||||
|
@ -539,10 +541,10 @@ func (this *ShopMgr) shopAddItem(p *Player, shopInfo *model.ShopInfo, vipShopId
|
|||
|
||||
// createOrder 保存购买记录
|
||||
func (this *ShopMgr) createOrder(p *Player, shopInfo *model.ShopInfo, costNum int64, amount [3]int32) {
|
||||
if shopInfo.Type < ShopTypeCoin && shopInfo.Type > ShopTypeItem {
|
||||
logger.Logger.Errorf("createOrder err: type = %v", shopInfo.Type)
|
||||
return
|
||||
}
|
||||
//if shopInfo.Type < ShopTypeCoin && shopInfo.Type >= ShopTypeMax {
|
||||
// logger.Logger.Errorf("createOrder err: type = %v", shopInfo.Type)
|
||||
// return
|
||||
//}
|
||||
|
||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||
dbShop := model.NewDbShop(p.Platform, shopInfo.Page, amount[:], "sys", 0, shopInfo.ConstType, int32(costNum),
|
||||
|
@ -1228,18 +1230,16 @@ func (this *ShopMgr) SendAPICreateOrder(p *Player, ConfigPayId int32, data any,
|
|||
amount[ShopTypeDiamond-1] = int32(addTotal)
|
||||
var itemInfo []model.ItemInfo
|
||||
var webItemInfo []*webapi_proto.ItemInfo
|
||||
if shopInfo.AddItemInfo != nil {
|
||||
for _, info := range shopInfo.AddItemInfo {
|
||||
for _, info := range shopInfo.GetItems() {
|
||||
itemInfo = append(itemInfo, model.ItemInfo{
|
||||
ItemId: info.ItemId,
|
||||
ItemNum: int64(info.ItemNum),
|
||||
ItemNum: info.ItemNum,
|
||||
})
|
||||
webItemInfo = append(webItemInfo, &webapi_proto.ItemInfo{
|
||||
ItemId: info.ItemId,
|
||||
ItemNum: info.ItemNum,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
dbShop = this.NewDbShop(p, shopInfo.Page, amount[:], ShopConsumeMoney, costNum,
|
||||
common.GainWay_ShopBuy, itemInfo, shopInfo.Id, shopInfo.Name, 0, remark, []int32{})
|
||||
|
|
Loading…
Reference in New Issue