我想显示 "modelyear
between 2003 to 2006 and modelyear between 2007 to 2009 AND price
between 1 lakh to 3 lakh and price between 3 lakh to 5 lakh"
在 2003 年至 2009 年之间具有 MEANS 记录且价格在 10 万至 50 万之间的记录,如 jabong.com 窄搜索。
我使用了以下(见下文)。但它不起作用。
有人可以建议,如何在wordpress 元查询中解决它?请!
<?php
$args2=array(
'posts_per_page' => 100,
'post_type' => 'product',
'post_status' => 'publish',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'year',
'value' => array(2003, 2006),
'compare' => 'BETWEEN',
//'type' => 'DECIMAL',
),
array(
'key' => 'year',
'value' => array(2007, 2009),
'compare' => 'BETWEEN',
//'type' => 'DECIMAL',
),
array(
'key' => '_price',
'value' => array(1, 3),
'compare' => 'BETWEEN',
//'type' => 'DECIMAL',
),
array(
'key' => '_price',
'value' => array(3, 5),
'compare' => 'BETWEEN',
//'type' => 'DECIMAL',
),
),
);
?>