明树Git Lab

Commit f50bc99d authored by zfp1's avatar zfp1

update

parent 2dff0b6c
......@@ -14,7 +14,12 @@
async function batchCreate(req, res, next) {
try {
let metals = req.body.metals;
let ret = await DB.HeavyMetal.insertMany(metals);
let arr = [];
for (let index = 0; index < metals.length; index++) {
const element = metals[index];
arr.push({data: element});
}
let ret = await DB.HeavyMetal.insertMany(arr);
return res.sendData(ret);
} catch (error) {
res.sendError(error);
......
......@@ -18,6 +18,12 @@ const letianHeavyMetalSchema = new Schema({
proWeightStatus: {
type: String,
comment: "产品重量状态"
},
time: {
type: Date,
},
data: {
},
createdAt: {
type: Date,
......
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