Merge pull request 'feat(salix): #7671 define isDestiny field in model' (!2681) from 7671_dense_itemFixedPrices into dev
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details

Reviewed-on: #2681
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Javier Segarra 2024-09-09 12:17:56 +00:00
commit 1a0fb2fecd
2 changed files with 8 additions and 1 deletions

View File

@ -25,6 +25,9 @@
"isManaged": {
"type": "boolean"
},
"isDestiny": {
"type": "boolean"
},
"countryFk": {
"type": "number"
}

View File

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