简体   繁体   English

如何在WordPress中使用(NOT IN)或(IN)使用Pod

[英]how to use (NOT IN) OR (IN) using pods in WordPress

i have this query in pods 我在豆荚里有这个查询

 $pod = pods( 'space' );

$where = array(
    'post_type'  => 'space',
    'relation' => 'AND',
    array(
        'key' => 'space_type_link',
        'value'   => $space_type,
        'compare' => 'LIKE',
    ),
    array(
        'key' => 'space_capacity',
        'value'   => $capacity_range_array,
        'type'    => 'numeric',
            'compare' => 'BETWEEN',
    )

);

$params = array(
    //'orderby' => 'date asc',
    //'limit' = > ,
    'where' => $where,
);

$pod->find($params);
return $pod;

and i'm trying to add one more condition to exclude some ID's from the query result like this 我正在尝试添加一个条件,以便从这样的查询结果中排除一些ID

array(
        'key' => 'id',
        'value'   => 91,
        'type'    => 'numeric',
        'compare' => 'NOT IN',
    ),

but is not working how can we fix this and many thanks in advance for any help. 但无法正常工作,我们要如何解决此问题,在此先感谢您的帮助。

正如您已经说过的, IN用于多个ID。

'value'   => array(91, 12, 23, 4),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM