game mall query
This commit is contained in:
parent
4170e36ddb
commit
1a800e02bb
@ -158,3 +158,40 @@ func (pai *PlayerApi) TicketConsumeQuery(c *gin.Context) {
|
|||||||
return p
|
return p
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (pai *PlayerApi) GameMallQuery(c *gin.Context) {
|
||||||
|
type GameMallQueryForm struct {
|
||||||
|
Order_id string `json:"order_id"`
|
||||||
|
Seller string `json:"seller"`
|
||||||
|
Seller_address string `json:"seller_address"`
|
||||||
|
}
|
||||||
|
|
||||||
|
reqJson := GameMallQueryForm{}
|
||||||
|
if !checkparam(&reqJson, c) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
filterstr := ""
|
||||||
|
if reqJson.Order_id != "" {
|
||||||
|
filterstr = " order_id = '" + reqJson.Order_id + "'"
|
||||||
|
} else if reqJson.Seller != "" {
|
||||||
|
filterstr = " seller = '" + reqJson.Seller + "'"
|
||||||
|
} else if reqJson.Seller_address != "" {
|
||||||
|
filterstr = " seller_address = '" + reqJson.Seller_address + "'"
|
||||||
|
} else {
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"code": 1,
|
||||||
|
"message": "input one of order_id, seller, seller_address",
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
cursor := q5.ToInt64(c.DefaultQuery("cursor", ""))
|
||||||
|
sql := fmt.Sprintf(`SELECT * FROM t_ingame_mall WHERE idx > %d AND %s `, cursor, filterstr)
|
||||||
|
|
||||||
|
query(constant.GAME_DB, cursor, sql, c, func(ds *f5.DataSet) interface{} {
|
||||||
|
p := new(system.MallItem)
|
||||||
|
p.LoadFromDs(ds)
|
||||||
|
return p
|
||||||
|
})
|
||||||
|
}
|
||||||
|
50
server/adminserver/model/system/mallitem.go
Normal file
50
server/adminserver/model/system/mallitem.go
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
package system
|
||||||
|
|
||||||
|
import (
|
||||||
|
"f5"
|
||||||
|
"q5"
|
||||||
|
)
|
||||||
|
|
||||||
|
type MallItem struct {
|
||||||
|
Idx int64 `json:"idx"`
|
||||||
|
Order_id string `gorm:"comment:订单id" json:"order_id"`
|
||||||
|
Order_type int `gorm:"comment:1:英雄 2:芯片 3:碎片 4:宝箱" json:"order_type"`
|
||||||
|
Seller string `gorm:"comment:seller" json:"seller"`
|
||||||
|
Seller_address string `gorm:"comment:seller_address" json:"seller_address"`
|
||||||
|
Goods_uniid string `gorm:"comment:物品id" json:"goods_uniid"`
|
||||||
|
Item_id int `gorm:"comment:道具id" json:"item_id"`
|
||||||
|
Item_num int64 `gorm:"comment:物品数量" json:"item_num"`
|
||||||
|
Price int64 `gorm:"comment:价格" json:"price"`
|
||||||
|
Status int `gorm:"comment:status" json:"status"`
|
||||||
|
Buyer string `gorm:"comment:购买成功者" json:"buyer"`
|
||||||
|
Buy_ok_time int `gorm:"comment:购买成功时间" json:"buy_ok_time"`
|
||||||
|
Last_modify_price_time int `gorm:"comment:最后一次修改价格时间" json:"last_modify_price_time"`
|
||||||
|
Createtime int `gorm:"comment:创建时间" json:"createtime"`
|
||||||
|
Modifytime int `gorm:"comment:修改时间" json:"modifytime"`
|
||||||
|
Order1 int `gorm:"comment:品质排序" json:"order1"`
|
||||||
|
Unit_price int `gorm:"comment:unit_price" json:"unit_price"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (gb *MallItem) TableName() string {
|
||||||
|
return "t_ingame_mall"
|
||||||
|
}
|
||||||
|
|
||||||
|
func (gb *MallItem) LoadFromDs(ds *f5.DataSet) {
|
||||||
|
gb.Idx = q5.ToInt64(ds.GetByName("idx"))
|
||||||
|
gb.Order_id = ds.GetByName("order_id")
|
||||||
|
gb.Order_type = q5.ToInt(ds.GetByName("order_type"))
|
||||||
|
gb.Seller = ds.GetByName("seller")
|
||||||
|
gb.Seller_address = ds.GetByName("seller_address")
|
||||||
|
gb.Goods_uniid = ds.GetByName("goods_uniid")
|
||||||
|
gb.Item_id = q5.ToInt(ds.GetByName("item_id"))
|
||||||
|
gb.Item_num = q5.ToInt64(ds.GetByName("item_num"))
|
||||||
|
gb.Price = q5.ToInt64(ds.GetByName("price"))
|
||||||
|
gb.Status = q5.ToInt(ds.GetByName("status"))
|
||||||
|
gb.Buyer = ds.GetByName("buyer")
|
||||||
|
gb.Buy_ok_time = q5.ToInt(ds.GetByName("buy_ok_time"))
|
||||||
|
gb.Last_modify_price_time = q5.ToInt(ds.GetByName("last_modify_price_time"))
|
||||||
|
gb.Createtime = q5.ToInt(ds.GetByName("createtime"))
|
||||||
|
gb.Modifytime = q5.ToInt(ds.GetByName("modifytime"))
|
||||||
|
gb.Order1 = q5.ToInt(ds.GetByName("order1"))
|
||||||
|
gb.Unit_price = q5.ToInt(ds.GetByName("unit_price"))
|
||||||
|
}
|
@ -17,5 +17,6 @@ func (pr *PlayerRouter) InitPlayerRouter(priRouter *gin.RouterGroup) {
|
|||||||
group.POST("heroesquery", api.HeroesQuery)
|
group.POST("heroesquery", api.HeroesQuery)
|
||||||
group.POST("goldbullionquery", api.GoldBullionQuery)
|
group.POST("goldbullionquery", api.GoldBullionQuery)
|
||||||
group.POST("ticketconsumequery", api.TicketConsumeQuery)
|
group.POST("ticketconsumequery", api.TicketConsumeQuery)
|
||||||
|
group.POST("gamemallquery", api.GameMallQuery)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user