public function getDonateHistorySuccess(\DateTime $dateTime)
    {
        $query = $this->createQueryBuilder('p')
            ->select('SUM(p.coins) as coins, p.type, COUNT(p.coins) as amount, p.created')
            ->where('p.success = :success')
            ->setParameter('success', Entity::STATUS_SUCCESS)
            ->andWhere('p.created >= :created')
            ->setParameter('created', $dateTime)
            ->groupBy('p.type, p.created')
            ->orderBy('p.created', 'asc')
            ->getQuery();

        return $query->getResult();
    }
public function getDonateHistorySuccess(\DateTime $dateTime)
    {
        $query = $this->createQueryBuilder('p')
            ->select('SUM(p.coins) as coins, p.type, COUNT(p.coins) as amount, p.created')
            ->where('p.success = :success')
            ->setParameter('success', Entity::STATUS_SUCCESS)
            ->andWhere('p.created >= :created')
            ->setParameter('created', $dateTime)
            ->groupBy('p.type, p.created')
            ->orderBy('p.created', 'asc')
            ->getQuery();

        return $query->getResult();
    }
public function getDonateHistorySuccess ( \ DateTime $ dateTime ) { $ query = $ this -> createQueryBuilder ( 'p' ) -> select ( 'SUM(p.coins) as coins, p.type, COUNT(p.coins) as amount, p.created' ) -> where ( 'p.success = :success' ) -> setParameter ( 'success' , Entity :: STATUS_SUCCESS ) -> andWhere ( 'p.created >= :created' ) -> setParameter ( 'created' , $ dateTime ) -> groupBy ( 'p.type, p.created' ) -> orderBy ( 'p.created' , 'asc' ) -> getQuery ( ) ; return $ query -> getResult ( ) ; }
Group date does not realy work on different DBMS, so we must do that in PHP

@param \DateTime $dateTime

@return array
Group date does not realy work on different DBMS so we must do that in PHP