Commit a4c66532 by 王悦

update

parent 6f9c865e
...@@ -88,27 +88,32 @@ class TrademarkCtl extends CtlBase { ...@@ -88,27 +88,32 @@ class TrademarkCtl extends CtlBase {
* {"error": ""} * {"error": ""}
*/ */
async publish(p, q, req) { async publish(p, q, req) {
let body = { try {
"tm": p let body = {
}; "tm": p
let upload = await this.uploadSve.create({ };
total: p.length let upload = await this.uploadSve.create({
}); total: p.length
body.upload_id = upload.id; });
let rtn = await pushClient(body); body.upload_id = upload.id;
if (rtn.status == 1) { let rtn = await pushClient(body);
let tradedb = []; if (rtn.status == 1) {
p.map(db => tradedb.push({ let tradedb = [];
opath: p.opath, p.map(db => tradedb.push({
user_id: p.userid, opath: p.opath,
company_id: p.company_id, user_id: p.userid,
// trademark_id: db.id, company_id: p.company_id,
tm_code: db.code, // trademark_id: db.id,
upload_id: upload.id tm_code: db.code,
})); upload_id: upload.id
rtn = await this.service.bulkCreate(tradedb); }));
rtn = await this.service.bulkCreate(tradedb);
}
return system.getResult(rtn)
}catch (e) {
return system.getResult(e)
} }
return system.getResult(rtn)
} }
/** /**
......
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