#6321 - Negative tickets #1945
|
@ -2,11 +2,11 @@ const {ParameterizedSQL} = require('loopback-connector');
|
|||
|
||||
module.exports = Self => {
|
||||
Self.remoteMethod('itemLackDetail', {
|
||||
description: 'Download a ticket delivery note document',
|
||||
description: 'Retrieve detail from ticket',
|
||||
jsegarra marked this conversation as resolved
Outdated
|
||||
accessType: 'READ',
|
||||
accepts: [
|
||||
{
|
||||
arg: 'id',
|
||||
arg: 'itemFk',
|
||||
jsegarra marked this conversation as resolved
Outdated
jgallego
commented
si estamos en la seccion ticket, yo el argumento lo llamaria itemFk, porque a mitad codigo, id puede dar confusion a que es el id de la entidad, en este caso ticket si estamos en la seccion ticket, yo el argumento lo llamaria itemFk, porque a mitad codigo, id puede dar confusion a que es el id de la entidad, en este caso ticket
|
||||
type: 'number',
|
||||
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 myOptions = {};
|
||||
|
@ -71,7 +71,7 @@ module.exports = Self => {
|
|||
AND t.landed >= util.VN_CURDATE()
|
||||
jsegarra marked this conversation as resolved
Outdated
jgallego
commented
(d.code = 'spainTeamVip') hasToIgnore (d.code = 'spainTeamVip') hasToIgnore
|
||||
AND t.landed < util.VN_CURDATE() + INTERVAL ? + 1 DAY
|
||||
jgallego marked this conversation as resolved
jgallego
commented
esto hace que las consultas sean muy lentas, hay que buscar alternativa, busca si encuentras otra consulta similar por la BBDD esto hace que las consultas sean muy lentas, hay que buscar alternativa, busca si encuentras otra consulta similar por la BBDD
jsegarra
commented
cambiado cambiado
|
||||
`,
|
||||
[id, 2]);
|
||||
[itemFk, 2]);
|
||||
|
||||
const sql = ParameterizedSQL.join([stmt], ';');
|
||||
const result = await conn.executeStmt(sql, myOptions);
|
||||
|
|
Loading…
Reference in New Issue
esta descripcion corresponde ?