خطای پایگاهدادهٔ وردپرس : [Unknown column 'wc_product_meta_lookup.stock_status' in 'order clause']SELECT SQL_CALC_FOUND_ROWS ss_posts.ID
FROM ss_posts LEFT JOIN ss_term_relationships ON (ss_posts.ID = ss_term_relationships.object_id) INNER JOIN ss_postmeta ON ( ss_posts.ID = ss_postmeta.post_id ) LEFT JOIN ss_wc_product_meta_lookup AS hello_wc_lookup ON (ss_posts.ID = hello_wc_lookup.product_id) LEFT JOIN ss_postmeta AS pardis_regular ON (ss_posts.ID = pardis_regular.post_id AND pardis_regular.meta_key = '_regular_price')
WHERE 1=1 AND (
ss_posts.ID NOT IN (
SELECT object_id
FROM ss_term_relationships
WHERE term_taxonomy_id IN (32372)
)
AND
ss_term_relationships.term_taxonomy_id IN (69,70,71,72,75,76,77,90,91,92,93,94,95,96,97,98,102,103,104,105,551,991,1013,1023,1026,1028,1033,1035,1039,1040,1042,1043,1046,1049,1051,1053,1054,6364,6365,6548,6549,6782,6783,6786,7911,9476,9478,9480,9482,9487,11991,11993,12341,12342,14484,14571,14572,15624,15630,15631,18305,18306,19902,20260,20289,20290,20307,20335,20712,20960,20981,21024,21083,21175,21202,21838,21839,21840,22366,22459,22895,23052,23053,23063,24284,24298,24604,25808,25815,26544,26545)
) AND (
ss_postmeta.meta_key = '_sale_price'
) AND ((ss_posts.post_type = 'product' AND (ss_posts.post_status = 'publish')))
GROUP BY ss_posts.ID
ORDER BY
CASE
WHEN (wc_product_meta_lookup.stock_status = 'instock' OR wc_product_meta_lookup.stock_status IS NULL OR wc_product_meta_lookup.stock_status = '')
AND wc_product_meta_lookup.min_price IS NOT NULL AND wc_product_meta_lookup.min_price > 0 THEN 0
WHEN wc_product_meta_lookup.stock_status = 'instock' OR wc_product_meta_lookup.stock_status IS NULL OR wc_product_meta_lookup.stock_status = '' THEN 1
WHEN wc_product_meta_lookup.stock_status = 'outofstock' THEN 2
ELSE 1
END ASC
, CASE
WHEN CAST(pardis_regular.meta_value AS DECIMAL(20,4)) > 0
AND CAST(hello_wc_lookup.min_price AS DECIMAL(20,4)) > 0
AND CAST(pardis_regular.meta_value AS DECIMAL(20,4)) > CAST(hello_wc_lookup.min_price AS DECIMAL(20,4))
THEN ((CAST(pardis_regular.meta_value AS DECIMAL(20,4)) - CAST(hello_wc_lookup.min_price AS DECIMAL(20,4))) / CAST(pardis_regular.meta_value AS DECIMAL(20,4)))
ELSE 0
END DESC, ss_posts.ID DESC
LIMIT 0, 30