diff --git a/server/payserver/api/v1/ingame/ingame.go b/server/payserver/api/v1/ingame/ingame.go index 687b088..7f4a1a9 100644 --- a/server/payserver/api/v1/ingame/ingame.go +++ b/server/payserver/api/v1/ingame/ingame.go @@ -26,6 +26,17 @@ func (iga *InGameApi) PreOrder(c *gin.Context) { return } + rspObj := struct { + ErrorCode int32 `json:"errcode"` + ErrMsg string `json:"errmsg"` + OrderId string `json:"order_id"` + }{} + + if !f5.IsOnlineEnv() { + c.JSON(200, rspObj) + return + } + data, ret := iga.checkSessionData(c, reqJson.AccountId) if !ret { return @@ -47,15 +58,7 @@ func (iga *InGameApi) PreOrder(c *gin.Context) { return } - rspObj := struct { - ErrorCode int32 `json:"errcode"` - ErrMsg string `json:"errmsg"` - OrderId string `json:"order_id"` - }{ - 0, - "", - order.OrderId, - } + rspObj.OrderId = order.OrderId c.JSON(200, rspObj) } @@ -268,6 +271,23 @@ func (iga *InGameApi) OrderInfo(c *gin.Context) { if err := c.ShouldBindJSON(&reqJson); err != nil { f5.RspErr(c, 401, "params error") return + } + + if !f5.IsOnlineEnv() { + rspObj := struct { + ErrorCode int32 `json:"errcode"` + ErrMsg string `json:"errmsg"` + OrderId string `json:"order_id"` + GoodsId int32 `json:"goods_id"` + Count int32 `json:"count"` + Others int32 `json:"others"` + Status int32 `json:"status"` + }{ + OrderId: reqJson.OrderId, + Status: 1, + } + c.JSON(200, rspObj) + return } data, ret := iga.checkSessionData(c, reqJson.AccountId) @@ -300,12 +320,6 @@ func (iga *InGameApi) OrderInfo(c *gin.Context) { Status: orderModel.Status, } - if !f5.IsOnlineEnv() { - count, _ := service.Wxpay.GetGoodsCount(q5.SafeToInt64(data["gameid"]), int64(orderModel.ItemId)) - rspObj.Count = int32(count) - rspObj.Status = 1 - } - c.JSON(200, rspObj) if orderModel.Status == 0 {