Commit a4c66532 by 王悦

update

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