Skip to content

Instantly share code, notes, and snippets.

@srsad
Created August 20, 2018 16:24
Show Gist options
  • Save srsad/a8a60ce08f64617f3ebfdb91dc8577de to your computer and use it in GitHub Desktop.
Save srsad/a8a60ce08f64617f3ebfdb91dc8577de to your computer and use it in GitHub Desktop.
Просто пример работы
$pdo = $modx->getService('pdoFetch');
$pdo->setConfig(array(
'class' => 'modResource',
'loadModels' => 'minishop2',
'class_key' => 'msProduct',
'parents' => '9920',
'leftJoin' => array(
'Data' => array(
'class' => 'msProductData',
'on' => 'modResource.id = Data.id',
),
'Option' => array(
'class' => 'msProductOption',
'on' => 'modResource.id = Option.product_id'
)
),
'where' => array('Option.key' => 'mstime'),
'select' => array(
'modResource' => 'id, pagetitle',
'Data' => 'price',
'Option' => 'value'
),
'return' => 'array'
));
echo $pdo->run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment