diff --git a/api/resolvers/item.js b/api/resolvers/item.js index 775118dd..65b4fcff 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -310,9 +310,9 @@ const LEFT_JOIN_SATS = function timedOrderBySats (num) { return `ORDER BY ((x.sats-1)/POWER(EXTRACT(EPOCH FROM ($${num} - "Item".created_at))/3600+2, 1.5) + - (x.boost)/POWER(EXTRACT(EPOCH FROM ($${num} - "Item".created_at))/3600+2, 9)) DESC NULLS LAST` + (x.boost)/POWER(EXTRACT(EPOCH FROM ($${num} - "Item".created_at))/3600+2, 5)) DESC NULLS LAST` } const ORDER_BY_SATS = `ORDER BY ((x.sats-1)/POWER(EXTRACT(EPOCH FROM ((NOW() AT TIME ZONE 'UTC') - "Item".created_at))/3600+2, 1.5) + - (x.boost)/POWER(EXTRACT(EPOCH FROM ((NOW() AT TIME ZONE 'UTC') - "Item".created_at))/3600+2, 9)) DESC NULLS LAST` + (x.boost)/POWER(EXTRACT(EPOCH FROM ((NOW() AT TIME ZONE 'UTC') - "Item".created_at))/3600+2, 5)) DESC NULLS LAST`