refs #6321 perf: minor change
gitea/salix/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Javier Segarra 2024-04-02 15:02:33 +02:00
parent 586f37afd2
commit cc3f2da639
1 changed files with 4 additions and 4 deletions

View File

@ -2,11 +2,11 @@ const {ParameterizedSQL} = require('loopback-connector');
module.exports = Self => { module.exports = Self => {
Self.remoteMethod('itemLackDetail', { Self.remoteMethod('itemLackDetail', {
description: 'Download a ticket delivery note document', description: 'Retrieve detail from ticket',
accessType: 'READ', accessType: 'READ',
accepts: [ accepts: [
{ {
arg: 'id', arg: 'itemFk',
type: 'number', type: 'number',
description: 'The item id', description: 'The item id',
}, },
@ -24,7 +24,7 @@ module.exports = Self => {
}, },
}); });
Self.itemLackDetail = async(id, options) => { Self.itemLackDetail = async(itemFk, options) => {
const conn = Self.dataSource.connector; const conn = Self.dataSource.connector;
const myOptions = {}; const myOptions = {};
@ -71,7 +71,7 @@ module.exports = Self => {
AND t.landed >= util.VN_CURDATE() AND t.landed >= util.VN_CURDATE()
AND t.landed < util.VN_CURDATE() + INTERVAL ? + 1 DAY AND t.landed < util.VN_CURDATE() + INTERVAL ? + 1 DAY
`, `,
[id, 2]); [itemFk, 2]);
const sql = ParameterizedSQL.join([stmt], ';'); const sql = ParameterizedSQL.join([stmt], ';');
const result = await conn.executeStmt(sql, myOptions); const result = await conn.executeStmt(sql, myOptions);