Условие выборки товаров msProducts

как вывести товары в категории «Часы» и все товары каталога у которых дополнительное поле -dopr (список ресурсов) равных ==«Часы»

пробовал так, но чувствую что туплю

[[!pdoPage?
        &element=`msProducts`
		&tpl=`productTpl`
		&depth=`6`
		&limit=`12`
		&includeTVs=`nal,dopr`
		&includeContent=`1`
		&processTVs=`1`
		&tvPrefix=``
		&sortby=`pagetitle`
		&sortdir=`asc`
		&where=`{{"template":"8"},{"id":"[[*id]]"},{"dopr":"[[*id]]"}}`
  	]]
Максим
21 декабря 2017, 09:45
modx.pro
2 570
0

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

Михаил
21 декабря 2017, 13:09
0
&where=`{{"template":"8"},{"id":"[[*id]]"},{"tv.dopr":"[[*id]]"}}`
    Максим
    21 декабря 2017, 14:04
    0
    не выводит почему-то, в раздел часы в товаре установил тв на кошельки, зашел в кошельки, а товар не отобразился из часов
      Михаил
      21 декабря 2017, 14:06
      0
      А можно
      &showLog=`1`
      показать?
        Максим
        21 декабря 2017, 14:10
        0
        0.0000658: pdoTools loaded. 0.0004261: Conditions prepared 0.0000219: xPDO query object created 0.0003788: Included list of tvs: dopr 0.0001202: leftJoined msProductData as Data 0.0000710: leftJoined msVendor as Vendor 0.0000670: leftJoined modTemplateVarResource as TVdopr 0.0000029: Grouped by msProduct.id 0.0000770: 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`, `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.0000479: Added selection of msProductData: `article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source` 0.0000391: 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.0000091: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `dopr` 0.0000360: Replaced TV conditions 0.0005040: Processed additional conditions 0.0009599: Added where condition: class_key=msProduct, msProduct.parent:IN(40,65,66,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162), msProduct.published=1, msProduct.deleted=0 0.0000060: Replaced TV conditions 0.0000730: Sorted by msProduct.pagetitle, asc 0.0000041: Limited to 12, offset 24 0.0001991: 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`.`content`, `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`, IFNULL(`TVdopr`.`value`, '') AS `dopr` 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_site_tmplvar_contentvalues` `TVdopr` ON `TVdopr`.`contentid` = `msProduct`.`id` AND `TVdopr`.`tmplvarid` = 21 WHERE ( `msProduct`.`class_key` = 'msProduct' AND `msProduct`.`parent` IN (40,65,66,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 ) GROUP BY msProduct.id ORDER BY msProduct.pagetitle asc LIMIT 24, 12 » 0.0024819: SQL executed 0.0000620: Total rows: 36 0.0000951: Rows fetched 0.0006349: Could not process or prepare TV «nal» 0.0019860: Could not process or prepare TV «nal» 0.0016310: Could not process or prepare TV «nal» 0.0012810: Could not process or prepare TV «nal» 0.0016758: Could not process or prepare TV «nal» 0.0013320: Could not process or prepare TV «nal» 0.0012660: Could not process or prepare TV «nal» 0.0015590: Could not process or prepare TV «nal» 0.0012710: Could not process or prepare TV «nal» 0.0015299: Could not process or prepare TV «nal» 0.0012641: Could not process or prepare TV «nal» 0.0012739: Could not process or prepare TV «nal» 0.0179498: Prepared and processed TVs 0.0000200: Returning raw data 0.0008941: Checked the active modifiers 0.0019741: Loaded «modChunk» with name «productTpl» 0.0040090: Compiled Fenom chunk with name «modchunk/42» 0.0058558: Time to load products options 0.0931959: Total time 6 291 456: Memory usage
          Михаил
          21 декабря 2017, 14:12
          0
          Could not process or prepare TV «nal» 0.0019860: Could not process or prepare TV «nal» 0.0016310: Could not process or prepare TV «nal» 0.0012810: Could not process or prepare TV «nal» 0.0016758: Could not process or prepare TV «nal» 0.0013320: Could not process or prepare TV «nal» 0.0012660: Could not process or prepare TV «nal» 0.0015590: Could not process or prepare TV «nal» 0.0012710: Could not process or prepare TV «nal» 0.0015299: Could not process or prepare TV «nal» 0.0012641: Could not process or prepare TV «nal» 0.0012739: Could not process or prepare TV «nal» 0.0179498: Prepared and processed TVs 0.0000200:
          processTV убери
            Максим
            21 декабря 2017, 14:24
            0
            не выводит все ровно

            [[!pdoPage?
                    &element=`msProducts`
            		&tpl=`productTpl`
            		&depth=`6`
            		&limit=`12`
            		&includeTVs=`dopr`
            		&includeContent=`1`
            		&tvPrefix=``
            		&sortby=`pagetitle`
            		&sortdir=`asc`
            		&showLog=`1`
            		&where=`{{"template":"8"},{"id":"[[*id]]"},{"tv.dopr":"[[*id]]"}}`
              	]]
            0.0000751: pdoTools loaded. 0.0004430: Conditions prepared 0.0000248: xPDO query object created 0.0004230: Included list of tvs: dopr 0.0001228: leftJoined msProductData as Data 0.0000730: leftJoined msVendor as Vendor 0.0000699: leftJoined modTemplateVarResource as TVdopr 0.0000041: Grouped by msProduct.id 0.0000770: 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`, `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.0000489: Added selection of msProductData: `article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source` 0.0000439: 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.0000069: Added selection of modTemplateVarResource: IFNULL(`value`, '') AS `dopr` 0.0000370: Replaced TV conditions 0.0010262: Processed additional conditions 0.0011969: Added where condition: class_key=msProduct, msProduct.parent:IN(40,65,66,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162), msProduct.published=1, msProduct.deleted=0 0.0000041: Replaced TV conditions 0.0000501: Sorted by msProduct.pagetitle, asc 0.0000019: Limited to 12, offset 24 0.0001931: 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`.`content`, `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`, IFNULL(`TVdopr`.`value`, '') AS `dopr` 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_site_tmplvar_contentvalues` `TVdopr` ON `TVdopr`.`contentid` = `msProduct`.`id` AND `TVdopr`.`tmplvarid` = 21 WHERE ( `msProduct`.`class_key` = 'msProduct' AND `msProduct`.`parent` IN (40,65,66,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 ) GROUP BY msProduct.id ORDER BY msProduct.pagetitle asc LIMIT 24, 12 » 0.0043790: SQL executed 0.0000980: Total rows: 36 0.0001061: Rows fetched 0.0001469: Returning raw data 0.0015221: Checked the active modifiers 0.0019369: Loaded «modChunk» with name «productTpl» 0.0046961: Compiled Fenom chunk with name «modchunk/42» 0.0073514: Time to load products options 0.1611950: Total time 6 291 456: Memory usage
    Баха Волков
    22 декабря 2017, 00:57
    0
    Эмм… Попробуй так:

    &where=`{"template":"8","id":"[[*id]]","tv.dopr":"[[*id]]"}`
      Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.
      7