Не работает вывод ":>" в optionFilters из msProducts
[[!msProducts?
&parents=`4`
&where=`{"class_key":"msProduct"}`
&optionFilters=`{"volume2:>":1000}`
&tpl=`emkosti`
&limit=`0`
&showLog=`1`
]]
Если нужно вывести только товары, у которых в значении 1000, то все правильно выводит:[[!msProducts?
&parents=`4`
&where=`{"class_key":"msProduct"}`
&optionFilters=`{"volume2":10000}`
&tpl=`emkosti`
&limit=`0`
&showLog=`1`
]]
Это ошибка в msProducts или я что-то не то делаю?Вот лог:
<pre class="msProductsLog">0.0000231: pdoTools loaded.
0.0021179: Conditions prepared
0.0000079: xPDO query object created
0.0000420: leftJoined <i>msProductData</i> as <b>Data</b>
0.0000241: leftJoined <i>msVendor</i> as <b>Vendor</b>
0.0001080: leftJoined <i>msProductOption</i> as <b>volume2</b>
0.0000010: Grouped by <b>msProduct.id</b>
0.0000281: Added selection of <b>msProduct</b>: <small>`id`, `type`, `contentType`, `pagetitle`, `longtitle`, `description`, `alias`, `alias_visible`, `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>msProductData</b>: <small>`article`, `price`, `old_price`, `weight`, `image`, `thumb`, `vendor`, `made_in`, `new`, `popular`, `favorite`, `tags`, `color`, `size`, `source`, `rank_42`, `rank_54`, `rank_114`, `rank_159`, `rank_79`, `rank_86`</small>
0.0000122: Added selection of <b>msVendor</b>: <small>`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`, `rank` AS `vendor.rank`</small>
0.0005932: Processed additional conditions
0.0006781: Added where condition: <b>class_key=msProduct, volume2.value:>=1000, msProduct.parent:IN(4,7,16,33,34,39,40,41,42,43,44,45,46,47,1865,177,8,170,180,184,193,182,190,194,196,198,206,208,210,212,233,236,240,242,265,244,256,258,260,262,276,278,280,282,284,286,288,290,292,294,296,298,302,310,312,314,316,318,320,322,324,362,364,366,368,370,372,374,375,377,379,381,383,385,387,389,391,393,395,397,399,401,403,405,407,409,411,413,415,417,442,444,446,448,450,188,200,203,204,214,216,218,220,222,224,226,228,230,246,248,250,252,254,266,268,270,272,274,300,303,306,308,326,328,330,332,334,336,338,340,342,344,346,348,350,352,354,356,421,419,358,360,423,425,427,429,431,433,435,438,440,1863,1879,1881,1883,453,1716,1718,1720,1722,1724,1726,1728,1730,1732,1734,1736,1738,1740,1742,1816,1818,1820,1822,1744,2005,1746,1748,1750,1752,1754,1756,1758,1760,1762,1764,1766,1768,1770,1786,1788,1790,1792,1794,1796,1798,1800,1802,1804,1806,1808,1810,1812,1814,1824,1828,1826,1830,1846,1832,1848,1834,1850,1836,1852,1838,1854,1840,1857,1842,1859,1844,1861,1772,1774,1776,1778,1780,1782,1784,2007,1885,1887,1889,1891,1893,1895,1897,1899,1901,1903,1906,1908,1910,1912), OR:msProduct.id:IN(1730,1732,1734,1736,1738,1740,1742,1760,1772,1772,1774,1774,1776,1776,1778,1778,1780,1780,1782,1782,1784,1784,1786,1788,1790,1792,1794,1796,1798,1800,1802,1804,1806,1808,1810,1812,1814,1824,1824,1826,1826,1828,1828,1830,1830,1846,1846,1848,1850,1852,1859,1861,1863,1879,1881), msProduct.published=1, msProduct.deleted=0</b>
0.0000150: Sorted by <b>msProduct.id</b>, <b>ASC</b>
0.0001321: SQL prepared <small>"SELECT `msProduct`.`id`, `msProduct`.`type`, `msProduct`.`contentType`, `msProduct`.`pagetitle`, `msProduct`.`longtitle`, `msProduct`.`description`, `msProduct`.`alias`, `msProduct`.`alias_visible`, `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`, `Data`.`rank_42`, `Data`.`rank_54`, `Data`.`rank_114`, `Data`.`rank_159`, `Data`.`rank_79`, `Data`.`rank_86`, `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`, `Vendor`.`rank` AS `vendor.rank` 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_options` `volume2` ON `volume2`.product_id = Data.id AND `volume2`.key = 'volume2' WHERE ( `msProduct`.`class_key` = 'msProduct' AND `volume2`.`value` > '1000' AND ( `msProduct`.`parent` IN (4,7,16,33,34,39,40,41,42,43,44,45,46,47,1865,177,8,170,180,184,193,182,190,194,196,198,206,208,210,212,233,236,240,242,265,244,256,258,260,262,276,278,280,282,284,286,288,290,292,294,296,298,302,310,312,314,316,318,320,322,324,362,364,366,368,370,372,374,375,377,379,381,383,385,387,389,391,393,395,397,399,401,403,405,407,409,411,413,415,417,442,444,446,448,450,188,200,203,204,214,216,218,220,222,224,226,228,230,246,248,250,252,254,266,268,270,272,274,300,303,306,308,326,328,330,332,334,336,338,340,342,344,346,348,350,352,354,356,421,419,358,360,423,425,427,429,431,433,435,438,440,1863,1879,1881,1883,453,1716,1718,1720,1722,1724,1726,1728,1730,1732,1734,1736,1738,1740,1742,1816,1818,1820,1822,1744,2005,1746,1748,1750,1752,1754,1756,1758,1760,1762,1764,1766,1768,1770,1786,1788,1790,1792,1794,1796,1798,1800,1802,1804,1806,1808,1810,1812,1814,1824,1828,1826,1830,1846,1832,1848,1834,1850,1836,1852,1838,1854,1840,1857,1842,1859,1844,1861,1772,1774,1776,1778,1780,1782,1784,2007,1885,1887,1889,1891,1893,1895,1897,1899,1901,1903,1906,1908,1910,1912) OR `msProduct`.`id` IN (1730,1732,1734,1736,1738,1740,1742,1760,1772,1772,1774,1774,1776,1776,1778,1778,1780,1780,1782,1782,1784,1784,1786,1788,1790,1792,1794,1796,1798,1800,1802,1804,1806,1808,1810,1812,1814,1824,1824,1826,1826,1828,1828,1830,1830,1846,1846,1848,1850,1852,1859,1861,1863,1879,1881) ) AND `msProduct`.`published` = 1 AND `msProduct`.`deleted` = 0 ) GROUP BY msProduct.id ORDER BY msProduct.id ASC "</small>
0.0111060: SQL executed
0.0005860: Rows fetched
0.0008779: Returning raw data
0.0005710: Checked the active modifiers
0.0016682: Loaded "modChunk" with name "emkosti"
0.0037210: Compiled Fenom chunk with name "modchunk/108"
0.0512455: Time to load products options
0.1335900: <b>Total time</b>
18 874 368: <b>Memory usage</b>
Комментарии: 3
попробуйте так:
&optionFilters=`{"volume2:>=":1000}`
к сожалению не помогло, выводит почему-то все товары (
Попробуйте через leftJoin и where. Условие с class_key в msProducts не нужно.
[[!msProducts?
&parents=`4`
&leftJoin=`{
"opt": {
"class": "msProductOption",
"on": "opt.key = 'volume2' AND opt.product_id = msProduct.id"
}
}`
&where=`["opt.volume2 > 1000"]`
&tpl=`emkosti`
&limit=`0`
]]
Авторизуйтесь или зарегистрируйтесь, чтобы оставлять комментарии.