diff --git a/src/controllers/games/gift.js b/src/controllers/games/gift.js index be6e6c1..759e7c6 100644 --- a/src/controllers/games/gift.js +++ b/src/controllers/games/gift.js @@ -27,7 +27,8 @@ router.post('/', async (req, res, next) => { const body = req.body try { const search = await GameGift.findOne({ - $or: [{gift_name: body.gift_name}, {gift_id: body.gift_id}], + game_id: body.game_id, + gift_id: body.gift_id, deleted: false, }) if (search) { @@ -145,7 +146,7 @@ router.post('/list', async (req, res, next) => { type: body.type, time: body.time, cfg: cfg, - extraData: body.extraData + extraData: body.extraData, }) const result = await list.save() res.send({ @@ -184,7 +185,7 @@ router.put('/list', async (req, res, next) => { type: body.type, time: body.time, cfg: cfg, - extraData: body.extraData + extraData: body.extraData, } ) res.send({ @@ -264,8 +265,9 @@ function formatCfg(type, timeStr) { startTime: parseInt(startTimeArr[0]) * 60 * 60 * 1000 + parseInt(startTimeArr[1]) * 60 * 1000, - endTime: parseInt(endTimeArr[0]) * 60 * 60 * 1000 + - parseInt(endTimeArr[1]) * 60 * 1000, + endTime: + parseInt(endTimeArr[0]) * 60 * 60 * 1000 + + parseInt(endTimeArr[1]) * 60 * 1000, limit: parseInt(cfg[1]), }) }) @@ -301,5 +303,4 @@ router.get('/record', async (req, res, next) => { } }) - export default router