明树Git Lab

Commit 2c9f0f51 authored by zfp1's avatar zfp1

update

parent 27fc5ca0
...@@ -43,7 +43,13 @@ async function batchCreate(req, res, next) { ...@@ -43,7 +43,13 @@ async function batchCreate(req, res, next) {
let metals = req.body.metals; let metals = req.body.metals;
let ret = []; let ret = [];
if(metals && metals.length) { if(metals && metals.length) {
ret = await DB.HeavyMetal.insertMany(metals); let arr = [];
for (let index = 0; index < metals.length; index++) {
const element = metals[index];
element.proHaveMetal = !element.proHaveMetal; //要取反,对方传递得true是没有金属
arr.push(element);
}
ret = await DB.HeavyMetal.insertMany(arr);
} else { } else {
let datas = req.body.datas; let datas = req.body.datas;
let arr = []; let arr = [];
......
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment