| Conditions | 2 |
| Paths | 2 |
| Total Lines | 26 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public function getNbPostDay($date1, $date2): array |
||
| 29 | { |
||
| 30 | //----- data nbPostDay |
||
| 31 | $query = $this->em->createQuery( |
||
| 32 | " |
||
| 33 | SELECT |
||
| 34 | ga.id, |
||
| 35 | COUNT(pc.id) as nb |
||
| 36 | FROM VideoGamesRecords\CoreBundle\Entity\PlayerChart pc |
||
| 37 | JOIN pc.chart c |
||
| 38 | JOIN c.group gr |
||
| 39 | JOIN gr.game ga |
||
| 40 | WHERE pc.lastUpdate BETWEEN :date1 AND :date2 |
||
| 41 | GROUP BY ga.id" |
||
| 42 | ); |
||
| 43 | |||
| 44 | $query->setParameter('date1', $date1); |
||
| 45 | $query->setParameter('date2', $date2); |
||
| 46 | $result = $query->getResult(); |
||
| 47 | |||
| 48 | $data = array(); |
||
| 49 | foreach ($result as $row) { |
||
| 50 | $data[$row['id']] = $row['nb']; |
||
| 51 | } |
||
| 52 | |||
| 53 | return $data; |
||
| 54 | } |
||
| 58 |