pdoTools фильтр по TV

[[!pdoPage?
&element=`msProducts`
&limit=`8`
&pageLimit=`4`
&tvFilters=`postavka==10`
]]
при этом ни один товар не выводится, но имеется с таким TV
Максим
31 мая 2017, 17:36
modx.pro
1
3 027
0

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

Максим
31 мая 2017, 20:44
0
&where=`{«postavka:=»:«10»}`
так тоже не работает
    Илья
    31 мая 2017, 20:44
    0
    Подключить нужно поля через includeTVs
      Максим
      31 мая 2017, 20:46
      0
      &includeTVs=`postavka`
      добавил, ситуация не изменилась
        Илья
        31 мая 2017, 20:50
        0
        Что показывают логи?
      Максим
      31 мая 2017, 20:53
      0
      0.0000861: xPDO query object created
      0.0009181: Included list of tvs:
      0.0004590: leftJoined msProductData as Data
      0.0002501: leftJoined msVendor as Vendor
      0.0048230: leftJoined msProductFile as 190x130
      0.0002630: leftJoined msProductFile as 360x24
      0.0000069: Grouped by msProduct.id
      0.0001569: Added selection of msProduct: 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.0000470: Added selection of msProductData: `article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`
      0.0000451: Added selection of msVendor: `name` AS `vendor.name`, `resource` AS `vendor.resource`, `country` AS `vendor.country`, `logo` AS `vendor.logo`, `address` AS `vendor.address`, `phone` AS `vendor.phone`, `fax` AS `vendor.fax`, `email` AS `vendor.email`, `description` AS `vendor.description`, `properties` AS `vendor.properties`
      0.0000331: Added selection of msProductFile: `url` as `190x130`
      0.0000329: Added selection of msProductFile: `url` as `360x24`
      0.0021839: Processed additional conditions
      0.0028679: Added where condition: class_key=msProduct, postavka:===10, msProduct.parent:IN(26,28,27,64,65,66,67,68,69,70,71,77), OR:msProduct.id:IN(27,64,65,66,67,68,69,70,71,77), msProduct.published=1, msProduct.deleted=0
      0.0001309: Sorted by Data.price,
      0.0000060: Limited to 8, offset 0
      0.0007999: SQL prepared «SELECT SQL_CALC_FOUND_ROWS `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`link_attributes`, `msProduct`.`published`, `msProduct`.`pub_date`, `msProduct`.`unpub_date`, `msProduct`.`parent`, `msProduct`.`isfolder`, `msProduct`.`introtext`, `msProduct`.`richtext`, `msProduct`.`template`, `msProduct`.`menuindex`, `msProduct`.`searchable`, `msProduct`.`cacheable`, `msProduct`.`createdby`, `msProduct`.`createdon`, `msProduct`.`editedby`, `msProduct`.`editedon`, `msProduct`.`deleted`, `msProduct`.`deletedon`, `msProduct`.`deletedby`, `msProduct`.`publishedon`, `msProduct`.`publishedby`, `msProduct`.`menutitle`, `msProduct`.`donthit`, `msProduct`.`privateweb`, `msProduct`.`privatemgr`, `msProduct`.`content_dispo`, `msProduct`.`hidemenu`, `msProduct`.`class_key`, `msProduct`.`context_key`, `msProduct`.`content_type`, `msProduct`.`uri`, `msProduct`.`uri_override`, `msProduct`.`hide_children_in_tree`, `msProduct`.`show_in_tree`, `msProduct`.`properties`, `Data`.`article`, `Data`.`price`, `Data`.`old_price`, `Data`.`weight`, `Data`.`image`, `Data`.`thumb`, `Data`.`vendor`, `Data`.`made_in`, `Data`.`new`, `Data`.`popular`, `Data`.`favorite`, `Data`.`tags`, `Data`.`color`, `Data`.`size`, `Data`.`source`, `Vendor`.`name` AS `vendor.name`, `Vendor`.`resource` AS `vendor.resource`, `Vendor`.`country` AS `vendor.country`, `Vendor`.`logo` AS `vendor.logo`, `Vendor`.`address` AS `vendor.address`, `Vendor`.`phone` AS `vendor.phone`, `Vendor`.`fax` AS `vendor.fax`, `Vendor`.`email` AS `vendor.email`, `Vendor`.`description` AS `vendor.description`, `Vendor`.`properties` AS `vendor.properties`, `190x130`.`url` as `190x130`, `360x24`.`url` as `360x24` FROM `modx_site_content` AS `msProduct` LEFT JOIN `modx_ms2_products` `Data` ON `msProduct`.`id`=`Data`.`id` LEFT JOIN `modx_ms2_vendors` `Vendor` ON `Data`.`vendor`=`Vendor`.`id` LEFT JOIN `modx_ms2_product_files` `190x130` ON `190x130`.`product_id` = `msProduct`.`id` AND `190x130`.`parent` != 0 AND `190x130`.`path` LIKE '%/190x130/' LEFT JOIN `modx_ms2_product_files` `360x24` ON `360x24`.`product_id` = `msProduct`.`id` AND `360x24`.`parent` != 0 AND `360x24`.`path` LIKE '%/360x24/' WHERE ( `msProduct`.`class_key` = 'msProduct' AND `msProduct`.`postavka` == '10' AND ( `msProduct`.`parent` IN (26,28,27,64,65,66,67,68,69,70,71,77) OR `msProduct`.`id` IN (27,64,65,66,67,68,69,70,71,77) ) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 ) GROUP BY msProduct.id ORDER BY Data.price LIMIT 8 „
      0.0006490: 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 '== '10' AND ( `msProduct`.`parent` IN (26,28,27,64,65,66,67,68,69,70,71,77) OR ' at line 1
      0.0223310: Total time
      7 340 032: Memory usage
        Максим
        31 мая 2017, 20:56
        0
        если вместо where поставить &tvFilters=`postavka==10`
        то ошибка
        Could not process query, error #1054: Unknown column 'postavka' in 'where clause'
          Илья
          31 мая 2017, 21:10
          0
          Я msProducts не пробовал выводить через pdopage (только через mFilter2), но думаю должно так работать:,

          [[!pdoPage? 
          &parents=`0`
          &element=`msProducts`
          &includeTVs=`postavka`
          &limit=`8`
          &ajaxMode=`default`
          &pageLimit=`4` 
          &where=`{"TVpostavka.value:LIKE":"%10%"}`
          ]]
            Илья
            31 мая 2017, 21:14
            0
            Или вместо where это:

            &tvFilters=`postavka==%10%`
              Максим
              31 мая 2017, 21:17
              0
              оба варианта не сработали
              заметил ещё, что в Included list of tvs: ничего не подключилось, хотя указал
            Максим
            31 мая 2017, 21:20
            0
            прошу прощения, кажется понял в чём проблема
            postavka, это не дополнительное поле, а опция в minishop2, как с этим быть?
              Илья
              31 мая 2017, 21:26
              +1
              Почему то я так и подумал сначала ))

              &optionFilters=`{"postavka": 10}`
                Максим
                31 мая 2017, 21:28
                0
                отлично, теперь работает
                большое спасибо
                  Илья
                  31 мая 2017, 21:29
                  0
                  Ага, пожалуйста)
              Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
              13