2014-02-20 29 views

回答

2

Xpdo查询例如:

$c = $modx->newQuery('modResource'); 
$c->where(array(
    'pagetitle:REGEXP' => '^([a-b]|[e-g]|p){1}(.*)$' 
    ,'isfolder' => 0 
)); 
$d = $modx->getCollection('modResource',$c); 

如果你想使用这个在getResources段紧挨着增加PAGETITLE和isfolder条件“其中”这样的属性已完成there

+0

谢谢!大。但现在我不幸陷入了点和斜线。你能帮我解决这个问题吗?这个例子是显示以字母“p”开头的所有文档的调用:[[getResources?parents ='3'&depth ='4'&tpl ='photoListSort'&display ='all'&sortby ='pagetitle'&sortdir ='ASC '& includeTVs ='1'&processTVs ='1'&tvPrefix =''&hideContainers ='1'&where = {{pagetitle:=“:REGEXP =>'^([p]){1}(。*)$' “isfolder:=”:0}']] –

+0

'where'条件存在错误。我使用=>,因为它是数组。 哪里有条件等待JSON。你必须试试这个: &where =“{”pagetitle:REGEXP“:”^([p]){1}(。*)$“,”isfolder:=“:0}' – proxyfabio

2

感谢@ proxyfabio提供了很大的帮助,并指导我朝着正确的方向发展。

我得到了最简单的感谢方式,在镆铘论坛@sottwell:

&where=`{"pagetitle:LIKE":"p%"}` 

&where=`{"pagetitle:LIKE":"l%","OR:pagetitle:LIKE":"m%","OR:pagetitle:LIKE":"n%","OR:pagetitleon:LIKE":"o%"}` 

一样容易。

相关问题