doctrine2 - how to use DATE_ADD function

后端 未结 1 1718
春和景丽
春和景丽 2021-02-19 02:56

I am trying to use the DATE_ADD function from doctrine2 but I am having trouble get it right.

I am using like this in DQL:

->andWhere(\'p         


        
1条回答
  •  后悔当初
    2021-02-19 03:26

    You have a typo, you have to quotes 'day'

    ->andWhere("p.created_at <= DATE_ADD(CURRENT_DATE(),4, 'day')")
    

    An example here.

    0 讨论(0)
提交回复
热议问题