maker
This commit is contained in:
parent
05de2d09e2
commit
e15eaea771
@ -185,7 +185,7 @@ router.post('/view', async (req, res, next) => {
|
|||||||
const body = req.body
|
const body = req.body
|
||||||
const _id = body._id
|
const _id = body._id
|
||||||
const search = await Maker.findOne({ _id })
|
const search = await Maker.findOne({ _id })
|
||||||
const view = search.view || 0
|
const view = parseInt(search.view) || 0
|
||||||
const result = await Maker.updateOne({ _id }, {
|
const result = await Maker.updateOne({ _id }, {
|
||||||
view: view + 1
|
view: view + 1
|
||||||
})
|
})
|
||||||
|
@ -10,7 +10,7 @@ const Maker = new mongoose.Schema({
|
|||||||
template: { type: String, default: '' },
|
template: { type: String, default: '' },
|
||||||
list: { type: Object, default: {} },
|
list: { type: Object, default: {} },
|
||||||
tags: { type: String, default: '' },
|
tags: { type: String, default: '' },
|
||||||
view: { type: String, default: 0 },
|
view: { type: Number, default: 0 },
|
||||||
isRecommand: { type: Boolean, default: false }
|
isRecommand: { type: Boolean, default: false }
|
||||||
}, {
|
}, {
|
||||||
collection: 'maker',
|
collection: 'maker',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user