From 575421449896ad977f362c47ad1d1d408e37f3a9 Mon Sep 17 00:00:00 2001 From: Nulo Date: Fri, 5 Jan 2024 15:40:54 -0300 Subject: [PATCH] search: poner cosas sin stock al final --- sitio/src/routes/search/+page.server.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sitio/src/routes/search/+page.server.ts b/sitio/src/routes/search/+page.server.ts index 3b1811d..e0f9f9d 100644 --- a/sitio/src/routes/search/+page.server.ts +++ b/sitio/src/routes/search/+page.server.ts @@ -11,7 +11,8 @@ 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) + order by p.in_stock desc;`; results = db.all(sqlQuery); }