Задать вопрос
@QTnub
Программист , музыкант , филантроп

Как составить выборку where в pdoResources modx revo?

Добрый день, подскажите пожалуйста как мне составить выборку по ТВ таким образом чтобы я мог выводить на странице только те ресурсы которые соответствуют полям , так же мне нужно указывать несколько значений в одном ТВ параметре , например цена 4000,5000,7000 вот мой код
[[!pdoPage?
            &element=`pdoResources`
            &tpl=`zayavka_block`
            &parents=`1`
            &tplPageActive=`@INLINE<li class="current"><a href="[[+href]]">[[+pageNo]]</a></li>`
            &cache=`1`
            &cacheTime=`1800`
            &includeTVs=`metro,img,price_do,price_ot,street,area,price,object_id,kavdrat_ot,kavdrat_do,okrug`
            &hideContainers=`1`
            &where=`{"metro:IN":[ [[*svod_metro]] ]}`
            &maxLimit=`9`
            &showLog=`1`
        ]]


если фильтровать по цене то все получается и выводится , но как только я пытаюсь фильтровать по станциям метро или округам , мне просто отдаются все ресурсы вне зависимости от того нужны они или нет , вот что пишет лог
<pre class="pdoResourcesLog">0.0001030: pdoTools loaded
0.0000250: xPDO query object created
0.0006289: Included list of tvs: <b>img, price_ot, price_do, price, street, kavdrat_ot, okrug, metro, area, object_id</b>
0.0002689: leftJoined <i>modTemplateVarResource</i> as <b>TVimg</b>
0.0002432: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_ot</b>
0.0002389: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_do</b>
0.0002511: leftJoined <i>modTemplateVarResource</i> as <b>TVprice</b>
0.0002370: leftJoined <i>modTemplateVarResource</i> as <b>TVstreet</b>
0.0002379: leftJoined <i>modTemplateVarResource</i> as <b>TVkavdrat_ot</b>
0.0002370: leftJoined <i>modTemplateVarResource</i> as <b>TVokrug</b>
0.0002520: leftJoined <i>modTemplateVarResource</i> as <b>TVmetro</b>
0.0002391: leftJoined <i>modTemplateVarResource</i> as <b>TVarea</b>
0.0002360: leftJoined <i>modTemplateVarResource</i> as <b>TVobject_id</b>
0.0004811: Added selection of <b>modResource</b>: <small>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`</small>
0.0000129: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.img`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price_ot`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price_do`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price`</small>
0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.street`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.kavdrat_ot`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.okrug`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.metro`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.area`</small>
0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.object_id`</small>
0.0000370: Replaced TV conditions
0.0005081: Processed additional conditions
0.0009921: Added where condition: <b>0=, modResource.parent:IN(1,38,39,17,19,21,9,18,20,23), modResource.published=1, modResource.deleted=0, modResource.isfolder=0</b>
0.0000379: Replaced TV conditions
0.0001240: Sorted by <b>modResource.publishedon</b>, <b>DESC</b>
0.0000031: Limited to <b>9</b>, offset <b></b>
0.0003400: SQL prepared <small>"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(`TVimg`.`value`, '') AS `tv.img`, IFNULL(`TVprice_ot`.`value`, '') AS `tv.price_ot`, IFNULL(`TVprice_do`.`value`, '') AS `tv.price_do`, IFNULL(`TVprice`.`value`, '') AS `tv.price`, IFNULL(`TVstreet`.`value`, '') AS `tv.street`, IFNULL(`TVkavdrat_ot`.`value`, '') AS `tv.kavdrat_ot`, IFNULL(`TVokrug`.`value`, '') AS `tv.okrug`, IFNULL(`TVmetro`.`value`, '') AS `tv.metro`, IFNULL(`TVarea`.`value`, '') AS `tv.area`, IFNULL(`TVobject_id`.`value`, '') AS `tv.object_id` FROM `modx_site_content` AS `modResource` LEFT JOIN `modx_site_tmplvar_contentvalues` `TVimg` ON `TVimg`.`contentid` = `modResource`.`id` AND `TVimg`.`tmplvarid` = 1 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVprice_ot` ON `TVprice_ot`.`contentid` = `modResource`.`id` AND `TVprice_ot`.`tmplvarid` = 11 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVprice_do` ON `TVprice_do`.`contentid` = `modResource`.`id` AND `TVprice_do`.`tmplvarid` = 12 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVprice` ON `TVprice`.`contentid` = `modResource`.`id` AND `TVprice`.`tmplvarid` = 13 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVstreet` ON `TVstreet`.`contentid` = `modResource`.`id` AND `TVstreet`.`tmplvarid` = 4 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVkavdrat_ot` ON `TVkavdrat_ot`.`contentid` = `modResource`.`id` AND `TVkavdrat_ot`.`tmplvarid` = 5 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVokrug` ON `TVokrug`.`contentid` = `modResource`.`id` AND `TVokrug`.`tmplvarid` = 8 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVmetro` ON `TVmetro`.`contentid` = `modResource`.`id` AND `TVmetro`.`tmplvarid` = 9 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVarea` ON `TVarea`.`contentid` = `modResource`.`id` AND `TVarea`.`tmplvarid` = 10 LEFT JOIN `modx_site_tmplvar_contentvalues` `TVobject_id` ON `TVobject_id`.`contentid` = `modResource`.`id` AND `TVobject_id`.`tmplvarid` = 16 WHERE  ( `modResource`.`parent` IN (1,38,39,17,19,21,9,18,20,23) AND `modResource`.`published` = 1 AND `modResource`.`deleted` = 0 AND `modResource`.`isfolder` = 0 )  ORDER BY modResource.publishedon DESC LIMIT 9 "</small>
0.0010729: SQL executed
0.0000679: Total rows: <b>7</b>
0.0000832: Rows fetched
0.0357409: Could not process or prepare TV "kavdrat_do"
0.0013330: Could not process or prepare TV "kavdrat_do"
0.0005260: Could not process or prepare TV "kavdrat_do"
0.0005450: Could not process or prepare TV "kavdrat_do"
0.0005112: Could not process or prepare TV "kavdrat_do"
0.0005529: Could not process or prepare TV "kavdrat_do"
0.0005090: Could not process or prepare TV "kavdrat_do"
0.0397282: Prepared and processed TVs
0.0007460: Loaded chunk "zayavka_block"
0.0871048: Returning processed chunks
0.1335518: <b>Total time</b>
11 272 192: <b>Memory usage</b>
</pre>
  • Вопрос задан
  • 9016 просмотров
Подписаться 4 Оценить Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы