明树Git Lab

Commit f50bc99d authored by zfp1's avatar zfp1

update

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