perf(salix): refs #6321 #7563 add ink.showOrder to procedure

This commit is contained in:
Javier Segarra 2024-06-12 22:19:59 +02:00
parent 02bc3afcda
commit 2cbd610bc2
2 changed files with 8 additions and 9 deletions

View File

@ -66,14 +66,7 @@ BEGIN
ELSE 1
END AS minQuantity,
iss.visible located,
b.price,
b.price1,
b.price2,
b.price3,
a.price,
a.price1,
a.price2,
a.price3,
b.price2
FROM vn.item i
JOIN cache.available a ON a.item_id = i.id
AND a.calc_id = vCalcFk
@ -87,6 +80,7 @@ BEGIN
LEFT JOIN vn.buy b ON b.id = lb.buy_id
LEFT JOIN vn.itemShelvingStock iss ON iss.itemFk = i.id
AND iss.warehouseFk = vWarehouseFk
LEFT JOIN vn.ink ink ON ink.id = i.tag5
JOIN itemTags its
WHERE a.available > 0
AND (i.typeFk = its.typeFk OR NOT vShowType)
@ -95,6 +89,7 @@ BEGIN
(t.name = its.name) DESC,
(it.value = its.value) DESC,
(i.tag5 = its.tag5) DESC,
(ink.`showOrder`) DESC,
match5 DESC,
(i.tag6 = its.tag6) DESC,
match6 DESC,

View File

@ -26,7 +26,11 @@ module.exports = Self => {
Object.assign(myOptions, options);
const where = filter.where;
const query = [where.itemFk, where.warehouseFk, where.date ?? Date.now(), where.showType ?? true];
const today =
new Date().toLocaleDateString('es-ES', {year: 'numeric',
month: '2-digit',
day: '2-digit'});
const query = [where.itemFk, where.warehouseFk, where.date ?? today, where.showType ?? true];
const [results] = await Self.rawSql('CALL vn.item_getSimilar(?, ?, ?, ?)', query, myOptions);
return [