pdoResource не работает параметр &depth

При вызове pdoResources параметр &depth=`1` не работает, т.е. выдает все дочерние ресурсы на два уровня вниз.

[[!pdoResources? &tpl=`myTpl.Category.row.block` &parents=`31`  &depth=`1` &includeTVs=`class-bgcolor,class-icon` &tvPrefix=`` &processTVs=`1` &showLog=`1`]]
0.0003371: pdoTools loaded
0.0001311: xPDO query object created
0.0011191: Included list of tvs: class-bgcolor, class-icon
0.0010521: leftJoined 
modTemplateVarResource
 as TVclass-bgcolor
0.0009241: leftJoined 
modTemplateVarResource
 as TVclass-icon
0.0013199: Added selection of modResource: SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
0.0000370: Added selection of TVclass-bgcolor: IFNULL(`value`, 'Нет==||') AS `class-bgcolor`
0.0000260: Added selection of TVclass-icon: IFNULL(`value`, '') AS `class-icon`
0.0020900: Processed additional conditions
0.0032561: Added where condition: modResource.parent:IN(31,91,92,93), modResource.published=1, modResource.deleted=0
0.0000799: Replaced TV conditions
0.0001280: Sorted by publishedon, DESC
0.0000141: Limited to 10, offset 0
0.0007129: SQL prepared "SELECT SQL_CALC_FOUND_ROWS `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties`, IFNULL(`TVclass-bgcolor`.`value`, 'Нет==||') AS `class-bgcolor`, IFNULL(`TVclass-icon`.`value`, '') AS `class-icon` FROM `modx_site_content` AS `modResource` LEFT JOIN `modx_site_tmplvar_contentvalues` `TVclass-bgcolor` ON `TVclass-bgcolor`.`contentid` = `modResource`.`id` AND `TVclass-bgcolor`.`tmplvarid` = 2 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVclass-icon` ON `TVclass-icon`.`contentid` = `modResource`.`id` AND `TVclass-icon`.`tmplvarid` = 1 WHERE  ( `modResource`.`parent` IN (31,91,92,93) AND `modResource`.`published` = 1 AND `modResource`.`deleted` = 0 )  ORDER BY publishedon DESC LIMIT 10 "
0.0015399: SQL executed
0.0041339: Total rows: 7
0.0001822: Rows fetched
0.0893831: Prepared and processed TVs
0.0029430: Loaded chunk "myTpl.Category.row.block"
0.0784869: Returning processed chunks
0.1835651: Total time
17 825 792: Memory usage


В pdoMenu наоборот, выводит только первый уровень, если снипет вызвать с параметром &level=`2`.

[[!pdoMenu? &tpl=`myTpl.Category.row.block` &parents=`31`  &level=`2` &includeTVs=`class-bgcolor,class-icon` &tvPrefix=`` &processTVs=`1` &showLog=`1`]]
0.0003159: pdoTools loaded
0.0000908: xPDO query object created
0.0012610: Included list of tvs: class-bgcolor, class-icon
0.0011110: leftJoined 
modTemplateVarResource
 as TVclass-bgcolor
0.0009799: leftJoined 
modTemplateVarResource
 as TVclass-icon
0.0017140: Added selection of modResource: SQL_CALC_FOUND_ROWS `id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `link_attributes`, `published`, `pub_date`, `unpub_date`, `parent`, `isfolder`, `introtext`, `content`, `richtext`, `template`, `menuindex`, `searchable`, `cacheable`, `createdby`, `createdon`, `editedby`, `editedon`, `deleted`, `deletedon`, `deletedby`, `publishedon`, `publishedby`, `menutitle`, `donthit`, `privateweb`, `privatemgr`, `content_dispo`, `hidemenu`, `class_key`, `context_key`, `content_type`, `uri`, `uri_override`, `hide_children_in_tree`, `show_in_tree`, `properties`
0.0000370: Added selection of TVclass-bgcolor: IFNULL(`value`, 'Нет==||') AS `class-bgcolor`
0.0000322: Added selection of TVclass-icon: IFNULL(`value`, '') AS `class-icon`
0.0019350: Processed additional conditions
0.0031590: Added where condition: modResource.parent:IN(31,91,92,93), modResource.published=1, modResource.hidemenu=0, modResource.deleted=0, modResource.context_key=web
0.0000849: Replaced TV conditions
0.0001290: Sorted by menuindex, ASC
0.0009470: SQL prepared "SELECT SQL_CALC_FOUND_ROWS `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`content`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties`, IFNULL(`TVclass-bgcolor`.`value`, 'Нет==||') AS `class-bgcolor`, IFNULL(`TVclass-icon`.`value`, '') AS `class-icon` FROM `modx_site_content` AS `modResource` LEFT JOIN `modx_site_tmplvar_contentvalues` `TVclass-bgcolor` ON `TVclass-bgcolor`.`contentid` = `modResource`.`id` AND `TVclass-bgcolor`.`tmplvarid` = 2 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVclass-icon` ON `TVclass-icon`.`contentid` = `modResource`.`id` AND `TVclass-icon`.`tmplvarid` = 1 WHERE  ( `modResource`.`parent` IN (31,91,92,93) AND `modResource`.`published` = 1 AND `modResource`.`hidemenu` = 0 AND `modResource`.`deleted` = 0 AND `modResource`.`context_key` = 'web' )  ORDER BY menuindex ASC "
0.0079720: SQL executed
0.0004220: Total rows: 7
0.0002120: Rows fetched
0.0624170: Prepared and processed TVs
0.0000830: Returning raw data
0.0000930: Tree was built
0.0000720: Start template tree
0.0055389: Loaded chunk "myTpl.Category.row.block"
0.0382180: Created inline chunk
0.0530300: End template tree
0.1784360: Total time
17 563 648: Memory usage

Версия pdoTools 1.8.6. Перед обновлением удалил все старые версии.
Денис Богдановский
03 ноября 2013, 11:02
modx.pro
3 189
0

Комментарии: 2

Василий Наумкин
03 ноября 2013, 15:59
0
А ты не думал, что они не просто так по разному называются: depth и level?
&level — уровень меню.
&depth — глубина выборки потомков.

Для вывод прямых потомков нужно указывать
&depth=`0`
Даю подсказку, почему именно так.
    Денис Богдановский
    03 ноября 2013, 16:59
    0
    А ты не думал, что они не просто так по разному называются: depth и level
    Именно об этом я подумал :) Теперь все понятно, спасибо!
    Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
    2