Perf: improve condition days filter
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javier Segarra 2024-07-13 18:07:46 +00:00
parent 1d23554508
commit 0ca4bffaf0
1 changed files with 1 additions and 2 deletions

View File

@ -1,4 +1,3 @@
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
const buildFilter = require('vn-loopback/util/filter').buildFilter;
const mergeFilters = require('vn-loopback/util/filter').mergeFilters;
@ -197,7 +196,7 @@ module.exports = Self => {
JOIN vn.currency cu ON cu.id = e.currencyFk`
);
if (supplier && ctx.args.days) {
if (ctx.args.days) {
stmt.merge({
sql: `
AND t.shipped < util.VN_CURDATE() + INTERVAL ? + 1 DAY