Skip to content

Instantly share code, notes, and snippets.

@4e6ka
Last active February 24, 2025 02:20
Show Gist options
  • Save 4e6ka/3187eb974d8c265f3fcde28ae68d7fc2 to your computer and use it in GitHub Desktop.
Save 4e6ka/3187eb974d8c265f3fcde28ae68d7fc2 to your computer and use it in GitHub Desktop.
Выборки modx json для where в pdoResources
Формат записи фильтров в pdoResources — чистый JSONxPDO, т.к. для этого используется JSONxPDO-параметр &where:
Проверка по типу документа
&where=`{"class_key":"modDocument"}`
rtfm.modx.com/display/xPDO20/xPDOQuery.where
`{«tv1»:«5»}`
`{«tv1:=»:«5»}`
`{«tv1:!=»:«5»}`
`{«tv1:>»:«5»}`
`{«tv1:>=»:«5»}`
`{«tv1:<»:«5»}`
`{«tv1:<=»:«5»}`
`{«tv1:LIKE»:"%5%"}`
`{«tv1:NOT LIKE»:"%5%"}`
`{«tv1:LIKE»:"%5%", «OR:tv2»:«8»}`
`{«tv:IN»:[7,8,9,10]}`
`{«tv:NOT IN»:[7,8,9,10]}`
`{«tv1:IS»:null}` // null — в нижнем регистре
`{«tv1:>=»:«5», «AND:tv2»:«8»}`
`{«tv1:<»:«5», «OR:tv2:LIKE»:"%58"}`
`{«tv1:!=»:«5», «OR:tv2:NOT LIKE»:"%8%"}`
`{«tv1:LIKE»:"%5%", «OR:tv2:!=»:«8»}`
`{«tv1:LIKE»:"%5%", «OR:tv2:<»:«8»}`
`{«tv1:LIKE»:"%5%", «AND:tv2:<»:«8», «OR:tv3:<»:«9»}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment