Skip to content

Instantly share code, notes, and snippets.

@pavel-one
Created July 7, 2018 01:54
Show Gist options
  • Save pavel-one/d30b4d3b5dc5e42c5a8530f1bcc11ef0 to your computer and use it in GitHub Desktop.
Save pavel-one/d30b4d3b5dc5e42c5a8530f1bcc11ef0 to your computer and use it in GitHub Desktop.
ms2 вывод уникальных тегов
{set $parents = '!pdoResources' | snippet: [
'returnIds' => 1,
'parents' => 9,
'depth'=> 15,
'limit' => 0,
'where' => [
'class_key' => 'msCategory'
]
]}
{set $parentsArr = $parents | split}
{'!pdoResources' | snippet: [
'class' => 'msProductOption',
'limit' => 0,
'sortby' => 'key',
'leftJoin' => [
'Resource' => [
'class' => 'modResource',
'on' => 'Resource.id = msProductOption.product_id'
],
],
'select' => [
'Resource' => 'parent',
'msProductOption' => '*'
],
'groupby' => 'msProductOption.value',
'where' => [
'key' => 'tags',
'Resource.parent:IN' => $parentsArr,
]
'tpl' => '',
]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment