string(944) "
SELECT p.ID
FROM aricun_wpposts p
INNER JOIN (
SELECT object_id
FROM aricun_wpterm_relationships tr
INNER JOIN aricun_wpterm_taxonomy tt
ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy = 'product_cat'
AND tt.term_id = %d
) AS term ON p.ID = term.object_id
INNER JOIN (
SELECT post_id
FROM aricun_wppostmeta
WHERE meta_key = '_stock_status'
AND meta_value = 'instock'
) AS stock_status ON p.ID = stock_status.post_id
INNER JOIN (
SELECT post_id
FROM aricun_wppostmeta
WHERE meta_key = '_stock'
AND meta_value > 0
) AS stock ON p.ID = stock.post_id
WHERE p.post_type = 'product'
AND p.post_status = 'publish'
ORDER BY p.post_date DESC
LIMIT %d OFFSET %d
"