你好,我想使用DATE_ADD
,但仍然出现错误
$invoices = $this->em->createQueryBuilder()
->select('i')
->from(InvoiceEntity::class, 'i')
->where('i.active = 1 AND i.paid = 0 AND DATE_ADD(i.due_date, 14, \'DAY\') <= :today')->setParameter('today', date('Y-m-d'))
->getQuery()->getResult();
错误:
[Syntax Error] line 0, col 98: Error: Expected `Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS`, got ','
`SELECT i FROM App\Entity\InvoiceEntity i WHERE i.active = 1 AND i.paid = 0 AND DATE_ADD(i.due_date, 14, 'DAY') <= :today`