1
This commit is contained in:
parent
a7b9b82e34
commit
c0d7840cb9
@ -226,3 +226,42 @@ SELECT * FROM t_sale WHERE idx > %d AND net_id = %d `,
|
||||
}
|
||||
c.JSON(200, rspObj)
|
||||
}
|
||||
|
||||
func (this *MarketApi) CategoryGoodsNum(c *gin.Context) {
|
||||
netId := q5.ToInt64(c.Param("net_id"))
|
||||
|
||||
rspObj := &struct {
|
||||
ErrCode int32 `json:"errcode"`
|
||||
ErrMsg string `json:"errmsg"`
|
||||
Data []struct{
|
||||
ItemId int32 `json:"item_id"`
|
||||
Num int32 `json:"num"`
|
||||
} `json:"data"`
|
||||
}{}
|
||||
q5.NewSlice(&rspObj.Data, 0, 10)
|
||||
|
||||
sql := fmt.Sprintf(`
|
||||
SELECT item_id, COUNT(idx) AS num FROM t_order WHEERE net_id = %d AND status="%s" AND item_id <> 0 GROUP BY item_id
|
||||
`,
|
||||
netId,
|
||||
constant.ORDER_STATUS_ACTIVE)
|
||||
params := []string{}
|
||||
f5.GetGoStyleDb().RawQuery(
|
||||
constant.BCNFT_DB,
|
||||
sql,
|
||||
params,
|
||||
func (err error, ds *f5.DataSet) {
|
||||
if err != nil {
|
||||
rspObj.ErrCode = 500
|
||||
rspObj.ErrMsg = "server internal error"
|
||||
c.JSON(200, rspObj)
|
||||
return
|
||||
}
|
||||
for ds.Next() {
|
||||
p := q5.NewSliceElement(&rspObj.Data)
|
||||
p.ItemId = q5.ToInt32(ds.GetByName("item_id"))
|
||||
p.Num = q5.ToInt32(ds.GetByName("num"))
|
||||
}
|
||||
c.JSON(200, rspObj)
|
||||
})
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
package gold_bullion
|
||||
|
||||
import (
|
||||
"f5"
|
||||
"main/api/v1"
|
||||
//"f5"
|
||||
//"main/api/v1"
|
||||
)
|
||||
|
||||
type GoldBullionRouter struct{}
|
||||
|
||||
func (this *GoldBullionRouter) InitRouter() {
|
||||
api := v1.ApiGroupApp.GoldBullionApiGroup
|
||||
f5.GetApp().GetGinEngine().POST("/api/gold_bullion/use/:net_id", api.GoldBullionApi.Use)
|
||||
//api := v1.ApiGroupApp.GoldBullionApiGroup
|
||||
// f5.GetApp().GetGinEngine().POST("/api/gold_bullion/use/:net_id", api.GoldBullionApi.Use)
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
package hero
|
||||
|
||||
import (
|
||||
"f5"
|
||||
"main/api/v1"
|
||||
//"f5"
|
||||
//"main/api/v1"
|
||||
)
|
||||
|
||||
type HeroRouter struct{}
|
||||
|
||||
func (this *HeroRouter) InitRouter() {
|
||||
api := v1.ApiGroupApp.HeroApiGroup
|
||||
f5.GetApp().GetGinEngine().POST("/api/hero/use/:net_id", api.HeroApi.Use)
|
||||
//api := v1.ApiGroupApp.HeroApiGroup
|
||||
//f5.GetApp().GetGinEngine().POST("/api/hero/use/:net_id", api.HeroApi.Use)
|
||||
}
|
||||
|
@ -12,4 +12,5 @@ func (this *MarketRouter) InitRouter() {
|
||||
f5.GetApp().GetGinEngine().POST("/api/market/product/list/:net_id", api.MarketApi.ProductList)
|
||||
f5.GetApp().GetGinEngine().GET("/api/market/transaction/history/:net_id/:account_address",
|
||||
api.MarketApi.TransactionHistory)
|
||||
f5.GetApp().GetGinEngine().GET("/api/market/product/category/:net_id", api.MarketApi.CategoryGoodsNum)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user