修正活动保存时, 错误的更新状态的bug

This commit is contained in:
zhl 2021-05-21 14:25:56 +08:00
parent 6abd7cfcf2
commit 3aaad6954a

View File

@ -51,7 +51,7 @@ class ShopactivityController extends BaseController {
record.updateFromReq(req.params)
}
if (record.active) {
await ShopActivity.updateMany({active: true}, {active: false})
await ShopActivity.updateMany({active: true, _id: {$ne: record._id}}, {active: false})
}
await record.save()
return record.toJson()