Skip to content

Instantly share code, notes, and snippets.

@cwage
Created August 30, 2010 20:39
Show Gist options
  • Save cwage/558019 to your computer and use it in GitHub Desktop.
Save cwage/558019 to your computer and use it in GitHub Desktop.
$filters = $this->getUser()->getAttribute('organization.filters',
null, 'admin_module');
$configuration = new organizationGeneratorConfiguration();
$filtersObj = $configuration->getFilterForm($filters);
$tableMethod = $configuration->getTableMethod();
$filtersObj->setTableMethod($tableMethod);
$query = $filtersObj->buildQuery($filters);
$alias = $query->getRootAlias();
$query->InnerJoin("$alias.BookOrders o WITH o.organization_id = $alias.id");
$query->addSelect("SUM(o.total) AS total_sales");
$query->addSelect("SUM(o.commission_total) AS total_commission");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment