教义使用date_add函数

时间:2018-08-24 08:53:55

标签: php mysql doctrine

你好,我想使用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`

0 个答案:

没有答案