Wordpress元查询无法正常工作

时间:2016-02-29 12:51:22

标签: wordpress

我有一个ajax功能可以加载更多旅程。我想从今天开始约会。 这是我的问题:

$page = $_POST['page'];
$not__in = $_POST['not__in'];
$post__not_in = explode(',', $not__in);
$lang =  $_POST['lang'];
$ship_id =  $_POST['ship_id'];
$today_date = date("Y-m-d");
$args = array (
            'showposts' => 20,
            'post_type' => 'journeys',
            'orderby' => 'post_date',
            'post_status' => 'publish',
            'order' => 'ASC',
            'paged' => $page,
            'post__not_in' => $post__not_in,
            'meta_query' => array(
                'relation' => 'AND',
                array(
                    'key' => 'journey_start_date',
                    'value' => $today_date,
                    'type' => 'date',
                    'compare' => '>'
                ),
                array(
                    'key' => 'journey_on_board_of',
                    'value' => $ship_id,                        
                    'compare' => 'IN'
                )                   
            )   
        );      
$the_journeys = new WP_Query( $args );

i var_dump $ the_journeys:

时的查询结果
SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID FROM wp_posts
JOIN wp_icl_translations t ON wp_posts.ID = t.element_id AND t.element_type = 'post_journeys' JOIN wp_icl_languages l ON t.language_code=l.code AND l.active=1 
WHERE 1=1  
AND wp_posts.ID NOT IN (7876,7878,7880,7884) 
AND wp_posts.post_type = 'journeys' 
AND ((wp_posts.post_status = 'publish')) 
AND t.language_code='en'  
ORDER BY wp_posts.post_date ASC 
LIMIT 0, 20

为什么我的查询没有关于日期的条件?

0 个答案:

没有答案