Выборка &where в pdoResources

Добрый день, появилась задача формировать содержимое страниц в зависимоти от содержимого ТВ, для этого решил использовать &where, делаю вот такой код
[[!pdoPage?
            &element=`pdoResources`
            &tpl=`zayavka_block`
            &parents=`1`
            &tplPageActive=`@INLINE<li class="current"><a href="[[+href]]">[[+pageNo]]</a></li>`
            &includeTVs=`price`
            &where=`{"price:LIKE":"[[*svod_price]]"}`
 ]]
все правильно работает, а вопрос состоит в том как сделать так чтобы в ТВ [[*svod_price]] можно было выставить несколько значений, например чтобы цена была не просто 3000, а 3000, 5000, 8500? заранее спсибо
Сергей Скат
04 сентября 2014, 12:23
modx.pro
4 604
0

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

Виталий Киреев
04 сентября 2014, 17:02
0
«price:IN»
    Сергей Скат
    04 сентября 2014, 17:09
    0
    так почему то ничего не выводит совсем
    <pre class="pdoResourcesLog">0.0000942: pdoTools loaded
    0.0000250: xPDO query object created
    0.0006039: Included list of tvs: <b>img, price_ot, price_do, price, street, kavdrat_ot, okrug, metro, area, object_id</b>
    0.0002630: 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.0002520: leftJoined <i>modTemplateVarResource</i> as <b>TVprice</b>
    0.0002360: leftJoined <i>modTemplateVarResource</i> as <b>TVstreet</b>
    0.0002360: leftJoined <i>modTemplateVarResource</i> as <b>TVkavdrat_ot</b>
    0.0002351: leftJoined <i>modTemplateVarResource</i> as <b>TVokrug</b>
    0.0002470: leftJoined <i>modTemplateVarResource</i> as <b>TVmetro</b>
    0.0002372: leftJoined <i>modTemplateVarResource</i> as <b>TVarea</b>
    0.0002372: leftJoined <i>modTemplateVarResource</i> as <b>TVobject_id</b>
    0.0004630: 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.0000088: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price_do`</small>
    0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price`</small>
    0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.street`</small>
    0.0000098: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.kavdrat_ot`</small>
    0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.okrug`</small>
    0.0000091: 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.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.object_id`</small>
    0.0000501: Replaced TV conditions
    0.0005021: Processed additional conditions
    0.0009050: Added where condition: <b>`TVprice`.`value`:IN=30000 , 4000, modResource.parent:IN(1,38,39,17,19,21,9,18,20,23), modResource.published=1, modResource.deleted=0, modResource.isfolder=0</b>
    0.0000319: Replaced TV conditions
    0.0001140: Sorted by <b>modResource.publishedon</b>, <b>DESC</b>
    0.0000021: Limited to <b>9</b>, offset <b></b>
    0.0003409: 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  ( `TVprice`.`value` IN '30000 , 4000' AND `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.0003741: Could not process query, error #1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''30000 , 4000' AND `modResource`.`parent` IN (1,38,39,17,19,21,9,18,20,23) AND `' at line 1
    0.0056310: <b>Total time</b>
    10 747 904: <b>Memory usage</b>
    </pre>
      Виталий Киреев
      04 сентября 2014, 17:15
      0
      &where=`{"price:IN":[ [[*svod_price]] ]}`
      Вот так по идее, т.к. там должен быть массив, то и передаем JSON-массивом.
        Сергей Скат
        04 сентября 2014, 17:20
        0
        так начал просто отдавать все ресурсы не смотря на цену
        <pre class="pdoResourcesLog">0.0000980: pdoTools loaded
        0.0000260: xPDO query object created
        0.0006058: Included list of tvs: <b>img, price_ot, price_do, price, street, kavdrat_ot, okrug, metro, area, object_id</b>
        0.0002670: leftJoined <i>modTemplateVarResource</i> as <b>TVimg</b>
        0.0002458: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_ot</b>
        0.0002582: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_do</b>
        0.0002420: leftJoined <i>modTemplateVarResource</i> as <b>TVprice</b>
        0.0002398: leftJoined <i>modTemplateVarResource</i> as <b>TVstreet</b>
        0.0002542: leftJoined <i>modTemplateVarResource</i> as <b>TVkavdrat_ot</b>
        0.0002530: leftJoined <i>modTemplateVarResource</i> as <b>TVokrug</b>
        0.0002410: leftJoined <i>modTemplateVarResource</i> as <b>TVmetro</b>
        0.0002420: leftJoined <i>modTemplateVarResource</i> as <b>TVarea</b>
        0.0002429: leftJoined <i>modTemplateVarResource</i> as <b>TVobject_id</b>
        0.0004730: 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.0000122: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.img`</small>
        0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price_ot`</small>
        0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price_do`</small>
        0.0000091: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.price`</small>
        0.0000100: Added selection of <b>modTemplateVarResource</b>: <small>IFNULL(`value`, '') AS `tv.street`</small>
        0.0000091: 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.0000091: 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.0000360: Replaced TV conditions
        0.0005240: Processed additional conditions
        0.0009849: 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.0000331: Replaced TV conditions
        0.0001209: Sorted by <b>modResource.publishedon</b>, <b>DESC</b>
        0.0000021: Limited to <b>9</b>, offset <b></b>
        0.0003231: 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.0009940: SQL executed
        0.0000660: Total rows: <b>7</b>
        0.0000811: Rows fetched
        0.0614228: Could not process or prepare TV "kavdrat_do"
        0.0055480: Could not process or prepare TV "kavdrat_do"
        0.0005412: Could not process or prepare TV "kavdrat_do"
        0.0005369: Could not process or prepare TV "kavdrat_do"
        0.0005240: Could not process or prepare TV "kavdrat_do"
        0.0033970: Could not process or prepare TV "kavdrat_do"
        0.0005429: Could not process or prepare TV "kavdrat_do"
        0.0725260: Prepared and processed TVs
        0.0007949: Loaded chunk "zayavka_block"
        0.0961871: Returning processed chunks
        0.1753349: <b>Total time</b>
        11 534 336: <b>Memory usage</b>
        </pre>
          Виталий Киреев
          04 сентября 2014, 17:37
          0
          0.0009849: Added where condition: <b>0=,
          Вот здесь видно, что явно что-то не то. Проверьте, чтобы все скобки и кавычки имели пару. У меня подобное условие проходит. Еще важно, чтобы [[*svod_price]] был не пустым, иначе условие IN () вызовет mysql ошибку.
            Сергей Скат
            04 сентября 2014, 18:28
            0
            получилось, спасибо за помощь
              Сергей Скат
              04 сентября 2014, 22:48
              0
              а как сделать несколько полей? вот так не работает =(

              [[!pdoPage?
                          &element=`pdoResources`
                          &tpl=`zayavka_block`
                          &parents=`1`
                          &tplPageActive=`@INLINE<li class="current"><a href="[[+href]]">[[+pageNo]]</a></li>`
                          &includeTVs=`price`
                          &where=`{"price:IN":"[[*svod_price]]"} , {"metor:IN":"[[*svod_metro]]"} `
               ]]
                Николай
                04 сентября 2014, 23:09
                0
                Если мне память не изменяет, то
                1. Ты не добавил выборку tv metor
                2. where=`{"":"","":""}`
                Могу ошибаться
                  Сергей Скат
                  05 сентября 2014, 00:44
                  0
                  [[!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=`{"price:IN":[ [[*svod_price]] ] , "metor:IN":[ [[*svod_metro]] ]}`
                              &maxLimit=`9`
                            
                          ]]
                  выводит все, не то что нужно
                    Виталий Киреев
                    05 сентября 2014, 04:51
                    0
                    &includeTVs=`metro
                    "metor:IN"
                      Сергей Скат
                      05 сентября 2014, 07:37
                      0
                      обратите внимание, metro есть в includeTVs, и в where указан, но почему то выводит все ресурсы
                        Виталий Киреев
                        05 сентября 2014, 09:45
                        0
                        ну вы написали metor а не metro.
                        Сергей Скат
                        05 сентября 2014, 10:13
                        0
                        да, я заметил, потому что упрощал код для понимания здесь, и кое что написал руками, полный код который работает на сайте выглядит так
                        [[!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=`{"price:IN":[ [[*svod_price]] ] ,"metro:IN":[ [[*svod_metro]] ] }`
                                    &maxLimit=`9`
                                    &showLog=`1`
                                ]]
                        и он не отрабатывает, просто выводит все ресурсы
                        Сергей Скат
                        05 сентября 2014, 13:13
                        0
                        с ценой вот все получается, а вот с метро нет
                      Сергей Скат
                      05 сентября 2014, 07:54
                      0
                      послед добавления еще одного параметра начинает выводить все, мне бы хотелось добавить не меньше трех параметров
                        Сергей Скат
                        05 сентября 2014, 08:38
                        0
                        вот что лог отдает
                        <pre class="pdoResourcesLog">0.0000999: pdoTools loaded
                        0.0000260: xPDO query object created
                        0.0006158: Included list of tvs: <b>img, price_ot, price_do, price, street, kavdrat_ot, okrug, metro, area, object_id</b>
                        0.0002701: leftJoined <i>modTemplateVarResource</i> as <b>TVimg</b>
                        0.0002460: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_ot</b>
                        0.0002570: leftJoined <i>modTemplateVarResource</i> as <b>TVprice_do</b>
                        0.0002429: leftJoined <i>modTemplateVarResource</i> as <b>TVprice</b>
                        0.0002410: leftJoined <i>modTemplateVarResource</i> as <b>TVstreet</b>
                        0.0002408: leftJoined <i>modTemplateVarResource</i> as <b>TVkavdrat_ot</b>
                        0.0002511: leftJoined <i>modTemplateVarResource</i> as <b>TVokrug</b>
                        0.0002391: leftJoined <i>modTemplateVarResource</i> as <b>TVmetro</b>
                        0.0002429: leftJoined <i>modTemplateVarResource</i> as <b>TVarea</b>
                        0.0002391: leftJoined <i>modTemplateVarResource</i> as <b>TVobject_id</b>
                        0.0004699: 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.0000088: 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.0000088: 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.0000501: Replaced TV conditions
                        0.0005231: Processed additional conditions
                        0.0010169: 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.0000341: Replaced TV conditions
                        0.0001199: Sorted by <b>modResource.publishedon</b>, <b>DESC</b>
                        0.0000019: Limited to <b>9</b>, offset <b></b>
                        0.0003178: 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.0011601: SQL executed
                        0.0000670: Total rows: <b>7</b>
                        0.0000670: Rows fetched
                        0.0339310: Could not process or prepare TV "kavdrat_do"
                        0.0013521: Could not process or prepare TV "kavdrat_do"
                        0.0005288: Could not process or prepare TV "kavdrat_do"
                        0.0005271: Could not process or prepare TV "kavdrat_do"
                        0.0005269: Could not process or prepare TV "kavdrat_do"
                        0.0005200: Could not process or prepare TV "kavdrat_do"
                        0.0005291: Could not process or prepare TV "kavdrat_do"
                        0.0379260: Prepared and processed TVs
                        0.0007751: Loaded chunk "zayavka_block"
                        0.0873880: Returning processed chunks
                        0.1321139: <b>Total time</b>
                        11 272 192: <b>Memory usage</b>
                        </pre>
        Виталий
        25 февраля 2017, 22:15
        0
        У меня тоже проблема с фильтром
        так
        &where=`["`TVzena-nds`.`value` >= 2000"] `
        или так
        &where=`["`TVzena-nds`.`value` >= 2000 AND `TVzena-nds`.`value` <= 2500"]`
        РАБОТАЕТ,
        но уже так
        &where=`["`TVzena-nds`.`value` >= 2000 AND `TVtovar-proiz-seria.`value` = АЛЬФА"]`
        или
        &where=`["`TVzena-nds`.`value` >= 2000 AND `TVtovar-proiz-seria.`value` = `АЛЬФА`"]`
        НЕ РАБОТАЕТ.
        и наоборот… когда отдельно хочу фильтровать строку, то РАБОТАЕТ такой вариант
        &where=`{«tovar-proiz-seria:=»:«АЛЬФА»}`
        но с ценой этот вариант
        &where=`{«zena-nds:>=»:«2000»}` не раболтает
        Уже перепробовал кучу вариантов… не могу допетрить в чём проблема
        Как совместить фильтр по цене(Цифре) + фильтр по производителю(Строке) ???
        Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
        18