adjust
This commit is contained in:
parent
a2bb2f599c
commit
dc85a37f84
@ -300,6 +300,7 @@ func (gca *GiftCodeApi) QueryCode(c *gin.Context) {
|
||||
ErrCode int32 `json:"errcode"`
|
||||
ErrMsg string `json:"errmsg"`
|
||||
CodeStatus int32 `json:"status"` //0:可用;1:已用;2:不存在
|
||||
Type int32 `json:"type"`
|
||||
}{}
|
||||
codeinfo := new(system.GiftCode)
|
||||
db := f5.GetApp().GetOrmDb(constant.ACCOUNT_DB).Table(codeinfo.TableName()).Take(codeinfo, "gameid = ? AND gift_code = '?'", req.GameId, req.Code)
|
||||
@ -312,6 +313,8 @@ func (gca *GiftCodeApi) QueryCode(c *gin.Context) {
|
||||
rspObj.CodeStatus = 2
|
||||
} else if codeinfo.Limit > 0 && codeinfo.Count > 0 {
|
||||
rspObj.CodeStatus = 1
|
||||
} else {
|
||||
rspObj.Type = codeinfo.GiftType
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, rspObj)
|
||||
|
Loading…
x
Reference in New Issue
Block a user