mirror of
https://github.com/catdevnull/preciazo.git
synced 2024-11-25 19:16:19 +00:00
search: elegir el que mas stock tenga
This commit is contained in:
parent
5754214498
commit
f645607adf
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ export const load: PageServerLoad = async ({ url }) => {
|
|||
join precios p on p.ean = f.ean
|
||||
where f.name match ${`"${query}"`}
|
||||
group by p.ean
|
||||
having max(p.fetched_at)
|
||||
having max(p.fetched_at) and max(p.in_stock)
|
||||
order by p.in_stock desc;`;
|
||||
results = db.all(sqlQuery);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue