SELECT SQL_CALC_FOUND_ROWS sm_posts.* FROM sm_posts LEFT JOIN sm_term_relationships ON (sm_posts.ID = sm_term_relationships.object_id) INNER JOIN sm_postmeta ON ( sm_posts.ID = sm_postmeta.post_id ) WHERE 1=1 AND ( sm_term_relationships.term_taxonomy_id IN (1473) OR sm_term_relationships.term_taxonomy_id IN (1473) ) AND ( ( sm_postmeta.meta_key = '_for_sale' AND sm_postmeta.meta_value = 'yes' ) ) AND sm_posts.post_type = 'product' AND (sm_posts.post_status = 'publish' OR sm_posts.post_status = 'acf-disabled') GROUP BY sm_posts.ID ORDER BY RAND() LIMIT 0, 20
SELECT SQL_CALC_FOUND_ROWS sm_posts.* FROM sm_posts LEFT JOIN sm_term_relationships ON (sm_posts.ID = sm_term_relationships.object_id) INNER JOIN sm_postmeta ON ( sm_posts.ID = sm_postmeta.post_id ) WHERE 1=1 AND ( sm_term_relationships.term_taxonomy_id IN (1473) OR sm_term_relationships.term_taxonomy_id IN (1473) ) AND ( ( sm_postmeta.meta_key = '_for_sale' AND sm_postmeta.meta_value = 'yes' ) ) AND sm_posts.post_type = 'product' AND (sm_posts.post_status = 'publish' OR sm_posts.post_status = 'acf-disabled') GROUP BY sm_posts.ID ORDER BY RAND() LIMIT 0, 20