refactor: refs #7884 modified sql
This commit is contained in:
parent
59c6d316dd
commit
c680c4a059
|
@ -229,19 +229,19 @@ module.exports = Self => {
|
||||||
|
|
||||||
if (daysAgo && daysOnward) {
|
if (daysAgo && daysOnward) {
|
||||||
sql = `
|
sql = `
|
||||||
AND t.shipped >= util.VN_CURDATE() - INTERVAL ? DAY
|
WHERE t.shipped >= util.VN_CURDATE() - INTERVAL ? DAY
|
||||||
AND t.shipped <= util.VN_CURDATE() + INTERVAL ? DAY
|
AND t.shipped <= util.VN_CURDATE() + INTERVAL ? DAY
|
||||||
`;
|
`;
|
||||||
params.push(daysAgo, daysOnward);
|
params.push(daysAgo, daysOnward);
|
||||||
} else if (daysAgo) {
|
} else if (daysAgo) {
|
||||||
sql = `
|
sql = `
|
||||||
AND t.shipped >= util.VN_CURDATE() - INTERVAL ? DAY
|
WHERE t.shipped >= util.VN_CURDATE() - INTERVAL ? DAY
|
||||||
AND t.shipped < util.VN_CURDATE()
|
AND t.shipped < util.VN_CURDATE()
|
||||||
`;
|
`;
|
||||||
params.push(daysAgo);
|
params.push(daysAgo);
|
||||||
} else if (daysOnward) {
|
} else if (daysOnward) {
|
||||||
sql = `
|
sql = `
|
||||||
AND t.shipped <= util.VN_CURDATE() + INTERVAL ? DAY
|
WHERE t.shipped <= util.VN_CURDATE() + INTERVAL ? DAY
|
||||||
AND t.shipped >= util.VN_CURDATE()
|
AND t.shipped >= util.VN_CURDATE()
|
||||||
`;
|
`;
|
||||||
params.push(daysOnward);
|
params.push(daysOnward);
|
||||||
|
|
Loading…
Reference in New Issue