parent
5a5032f6e6
commit
68158f341d
|
@ -1,4 +1,3 @@
|
|||
const {ParameterizedSQL} = require('loopback-connector');
|
||||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethod('negativeOrigin', {
|
||||
|
@ -27,10 +26,7 @@ module.exports = Self => {
|
|||
tx = await Self.beginTransaction({});
|
||||
myOptions.transaction = tx;
|
||||
}
|
||||
const conn = Self.dataSource.connector;
|
||||
const stmts = ['SELECT * FROM vn.negativeOrigin'];
|
||||
const sql = ParameterizedSQL.join(stmts, ';');
|
||||
const result = await conn.executeStmt(sql, myOptions);
|
||||
return result;
|
||||
const negativesOrigin = await Self.app.models.NegativeOrigin.find();
|
||||
return negativesOrigin;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -35,6 +35,9 @@
|
|||
"PackingSiteConfig": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"NegativeOrigin": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"ExpeditionMistake": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"name": "NegativeOrigin",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "negativeOrigin"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "number",
|
||||
"description": "Identifier"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"item": {
|
||||
"type": "belongsTo",
|
||||
"model": "Item",
|
||||
"foreignKey": "itemFk"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue