使用date\u add函数

hlswsv35  于 2021-06-20  发布在  Mysql
关注(0)|答案(0)|浏览(219)

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

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题