fixed filter #800
This commit is contained in:
parent
d0f1c582a4
commit
8db866339c
|
@ -22,6 +22,7 @@ module.exports = Self => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.getTransactions = async filter => {
|
Self.getTransactions = async filter => {
|
||||||
|
let conn = Self.dataSource.connector;
|
||||||
let stmt = new ParameterizedSQL(`
|
let stmt = new ParameterizedSQL(`
|
||||||
SELECT
|
SELECT
|
||||||
t.id,
|
t.id,
|
||||||
|
@ -36,7 +37,7 @@ module.exports = Self => {
|
||||||
LEFT JOIN hedera.tpvResponse tt ON tt.id = t.response
|
LEFT JOIN hedera.tpvResponse tt ON tt.id = t.response
|
||||||
LEFT JOIN hedera.tpvError te ON te.code = errorCode`);
|
LEFT JOIN hedera.tpvError te ON te.code = errorCode`);
|
||||||
|
|
||||||
stmt.merge(Self.buildSuffix(filter, 't'));
|
stmt.merge(conn.makeSuffix(filter, 't'));
|
||||||
|
|
||||||
return await Self.rawStmt(stmt);
|
return await Self.rawStmt(stmt);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const ParameterizedSQL = require('vn-loopback/node_modules/loopback-connector').ParameterizedSQL;
|
const ParameterizedSQL = require('vn-loopback/node_modules/loopback-connector').ParameterizedSQL;
|
||||||
|
|
||||||
module.exports = (Self) => {
|
module.exports = Self => {
|
||||||
Self.remoteMethod('filter', {
|
Self.remoteMethod('filter', {
|
||||||
description: 'Find all instances of the model matched by filter from the data source.',
|
description: 'Find all instances of the model matched by filter from the data source.',
|
||||||
accessType: 'READ',
|
accessType: 'READ',
|
||||||
|
@ -22,7 +22,7 @@ module.exports = (Self) => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.filter = async (filter) => {
|
Self.filter = async filter => {
|
||||||
const stmt = new ParameterizedSQL(
|
const stmt = new ParameterizedSQL(
|
||||||
`SELECT
|
`SELECT
|
||||||
e.id,
|
e.id,
|
||||||
|
|
Loading…
Reference in New Issue