|
@@ 653-663 (lines=11) @@
|
| 650 |
|
* |
| 651 |
|
* @return array [value, source] |
| 652 |
|
*/ |
| 653 |
|
public function getOpportunitiesCountGroupByLeadSource( |
| 654 |
|
AclHelper $aclHelper, |
| 655 |
|
DateFilterProcessor $dateFilterProcessor, |
| 656 |
|
array $dateRange = [], |
| 657 |
|
array $owners = [] |
| 658 |
|
) { |
| 659 |
|
$qb = $this->getOpportunitiesGroupByLeadSourceQueryBuilder($dateFilterProcessor, $dateRange, $owners); |
| 660 |
|
$qb->addSelect('count(o.id) as value'); |
| 661 |
|
|
| 662 |
|
return $aclHelper->apply($qb)->getArrayResult(); |
| 663 |
|
} |
| 664 |
|
|
| 665 |
|
/** |
| 666 |
|
* Returns budget amount of opportunities grouped by lead source |
|
@@ 675-685 (lines=11) @@
|
| 672 |
|
* |
| 673 |
|
* @return array [value, source] |
| 674 |
|
*/ |
| 675 |
|
public function getOpportunitiesAmountGroupByLeadSource( |
| 676 |
|
AclHelper $aclHelper, |
| 677 |
|
DateFilterProcessor $dateFilterProcessor, |
| 678 |
|
array $dateRange = [], |
| 679 |
|
array $owners = [] |
| 680 |
|
) { |
| 681 |
|
$qb = $this->getOpportunitiesGroupByLeadSourceQueryBuilder($dateFilterProcessor, $dateRange, $owners); |
| 682 |
|
$qb->addSelect("SUM(CASE WHEN o.status = 'won' THEN o.closeRevenue ELSE o.budgetAmount END) as value"); |
| 683 |
|
|
| 684 |
|
return $aclHelper->apply($qb)->getArrayResult(); |
| 685 |
|
} |
| 686 |
|
|
| 687 |
|
/** |
| 688 |
|
* Returns opportunities QB grouped by lead source filtered by $dateRange and $owners |