8032-devToTest_2440 #3009
|
@ -25,6 +25,9 @@
|
||||||
"isManaged": {
|
"isManaged": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
},
|
},
|
||||||
|
"isDestiny": {
|
||||||
|
"type": "boolean"
|
||||||
|
},
|
||||||
"countryFk": {
|
"countryFk": {
|
||||||
"type": "number"
|
"type": "number"
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,9 @@ module.exports = Self => {
|
||||||
return {[param]: value};
|
return {[param]: value};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (ctx.req.query?.showBadDates === 'true')
|
||||||
|
where['fp.started'] = {gte: Date.vnNew()};
|
||||||
|
|
||||||
filter = mergeFilters(filter, {where});
|
filter = mergeFilters(filter, {where});
|
||||||
|
|
||||||
const stmts = [];
|
const stmts = [];
|
||||||
|
@ -136,6 +139,7 @@ module.exports = Self => {
|
||||||
SELECT DISTINCT fp.id,
|
SELECT DISTINCT fp.id,
|
||||||
fp.itemFk,
|
fp.itemFk,
|
||||||
fp.warehouseFk,
|
fp.warehouseFk,
|
||||||
|
w.name warehouseName,
|
||||||
fp.rate2,
|
fp.rate2,
|
||||||
fp.rate3,
|
fp.rate3,
|
||||||
fp.started,
|
fp.started,
|
||||||
|
@ -159,6 +163,7 @@ module.exports = Self => {
|
||||||
FROM priceFixed fp
|
FROM priceFixed fp
|
||||||
JOIN item i ON i.id = fp.itemFk
|
JOIN item i ON i.id = fp.itemFk
|
||||||
JOIN itemType it ON it.id = i.typeFk
|
JOIN itemType it ON it.id = i.typeFk
|
||||||
|
JOIN warehouse w ON fp.warehouseFk = w.id
|
||||||
`);
|
`);
|
||||||
|
|
||||||
if (ctx.args.tags) {
|
if (ctx.args.tags) {
|
||||||
|
@ -184,7 +189,6 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
|
|
||||||
stmt.merge(conn.makeSuffix(filter));
|
stmt.merge(conn.makeSuffix(filter));
|
||||||
|
|
||||||
const fixedPriceIndex = stmts.push(stmt) - 1;
|
const fixedPriceIndex = stmts.push(stmt) - 1;
|
||||||
const sql = ParameterizedSQL.join(stmts, ';');
|
const sql = ParameterizedSQL.join(stmts, ';');
|
||||||
const result = await conn.executeStmt(sql, myOptions);
|
const result = await conn.executeStmt(sql, myOptions);
|
||||||
|
|
Loading…
Reference in New Issue