Newsletter recommendations tweaks, add enter to blur on validation table
This commit is contained in:
@@ -31,13 +31,14 @@ const CATEGORY_FILTERS = {
|
||||
back_in_stock: "AND is_back_in_stock = true",
|
||||
bestsellers: "AND shop_score > 20 AND COALESCE(current_stock, 0) > 0 AND COALESCE(sales_30d, 0) > 0",
|
||||
never_featured: "AND times_featured IS NULL AND line_last_featured_at IS NULL",
|
||||
no_interest: "AND COALESCE(total_sold, 0) = 0 AND COALESCE(current_stock, 0) > 0 AND COALESCE(date_online, product_created_at) <= CURRENT_DATE - INTERVAL '30 days'",
|
||||
};
|
||||
|
||||
function buildScoredCTE({ forCount = false } = {}) {
|
||||
// forCount=true returns minimal columns for COUNT(*)
|
||||
const selectColumns = forCount ? `
|
||||
p.pid,
|
||||
p.created_at,
|
||||
p.created_at as product_created_at,
|
||||
p.date_online,
|
||||
p.shop_score,
|
||||
p.preorder_count,
|
||||
|
||||
Reference in New Issue
Block a user