This commit is contained in:
yangduo 2025-04-30 16:43:48 +08:00
parent 5a78d63c9e
commit 27cbd85a84

View File

@ -353,11 +353,11 @@ func (gca *GiftCodeApi) UseCode(c *gin.Context) {
Type int32 `json:"type"` Type int32 `json:"type"`
}{} }{}
codeinfo := new(system.GiftCode) codeinfo := new(system.GiftCode)
db := f5.GetApp().GetOrmDb(constant.ACCOUNT_DB).Table(codeinfo.TableName()).Take(codeinfo, "gameid = ? AND gift_code = '?'", req.GameId, req.Code) db := f5.GetApp().GetOrmDb(constant.ACCOUNT_DB).Table(codeinfo.TableName()).Take(codeinfo, "gameid = ? AND gift_code = ?", req.GameId, req.Code)
err := db.Error err := db.Error
if err != nil { if err != nil {
if !f5.IsOrmErrRecordNotFound(err) { if !f5.IsOrmErrRecordNotFound(err) {
f5.RspErr2(c, 1, err.Error()) f5.RspErr(c, 1, err.Error())
return return
} }
rspObj.CodeStatus = 2 rspObj.CodeStatus = 2