Skip to content

Instantly share code, notes, and snippets.

@pavel-one
Created July 7, 2018 01:55
Show Gist options
  • Save pavel-one/03978bbeeab10300fcaebc3cf6a9621f to your computer and use it in GitHub Desktop.
Save pavel-one/03978bbeeab10300fcaebc3cf6a9621f 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' => 'msVendor',
'sortby' => 'id',
'leftJoin' => [
'Data' => [
'class' => 'msProductData',
'on' => 'Data.vendor = msVendor.id'
],
'modResource' => [
'class' => 'modResource',
'on' => 'Data.id = modResource.id'
]
],
'select' => 'msVendor.id, msVendor.name, Data.id as resourceId, modResource.parent',
'groupby' => 'msVendor.id',
'tpl' => 'test1',
'where' => [
'modResource.parent:IN' => $parentsArr,
],
]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment