@@ 116-125 (lines=10) @@ | ||
113 | * |
|
114 | * @return int |
|
115 | */ |
|
116 | public function getNewCustomersCountValues($dateRange) |
|
117 | { |
|
118 | list($start, $end) = $this->dateHelper->getPeriod($dateRange, 'OroCRMMagentoBundle:Customer', 'createdAt'); |
|
119 | $qb = $this->getCustomerRepository()->getNewCustomersNumberWhoMadeOrderQB(); |
|
120 | $this->applyDateFiltering($qb, 'orders.createdAt', $start, $end); |
|
121 | $this->applyDateFiltering($qb, 'customer.createdAt', $start, $end); |
|
122 | $value = $this->aclHelper->apply($qb)->getOneOrNullResult(); |
|
123 | ||
124 | return $value['val'] ? : 0; |
|
125 | } |
|
126 | ||
127 | /** |
|
128 | * @param array $dateRange |
|
@@ 132-145 (lines=14) @@ | ||
129 | * |
|
130 | * @return int |
|
131 | */ |
|
132 | public function getReturningCustomersCountValues($dateRange) |
|
133 | { |
|
134 | list($start, $end) = $this->dateHelper->getPeriod($dateRange, 'OroCRMMagentoBundle:Customer', 'createdAt'); |
|
135 | $qb = $this->getCustomerRepository()->getReturningCustomersWhoMadeOrderQB(); |
|
136 | $this->applyDateFiltering($qb, 'orders.createdAt', $start, $end); |
|
137 | if ($start) { |
|
138 | $qb |
|
139 | ->andWhere('customer.createdAt < :start') |
|
140 | ->setParameter('start', $start); |
|
141 | } |
|
142 | $value = $this->aclHelper->apply($qb)->getOneOrNullResult(); |
|
143 | ||
144 | return $value['val'] ? : 0; |
|
145 | } |
|
146 | ||
147 | /** |
|
148 | * @param array $dateRange |