خطای پایگاهدادهٔ وردپرس : [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 (47,58,60,61,62,63,64,227,236,17952,22076,26696,31521,31522,31523,31524,31525,32938,33151,33152,33153,33154,33155,33156,33157,33158,33159,33162,33163,33165,33166,33168,33169,33170,33171,33172,33173,33174,33175,33176,33177,33178,33179,33180,33181,33182,33183,33184,33185,33186,33187,33188,33189,33190,33191,33192,33193,33194,33195,33196,33197,33198,33199,33200,33201,33202,33203,33204,33205,33206,33207,33208,33209,33210,33211,33294,33330,33331,33332,33333,33334,33335,33336,33337,33338,33339,33340,33341,33342,33343,33344,33345,33346,33347,33348,33349,33350,33351,33352,33353,33355,33356,33357,33358,33359,33360,33361,33362,33363,33364,33365,33366,33367,33368,33369,33440,33441,33442,33443,33444,33445,33457,33463,33464,33465,33466,33467,33468,33469,33470,33471,33472,33474,33475,33477,33479,33480,33481,33483,33484,33485,33486,33487,33491,33492,33494,33498)
) 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