我试图在 Doctrine 2 的 where 条件下的查询构建器中使用当前年份,但这是不可能的。用 My SQL 没问题,但用 Doctrine 无事可做,它不起作用。那么有人可以帮我解决这个问题吗?
我试过(一个一个):
->where('year = CURRENT_TIMESTAMP()')
->where('SUBSTRING(i.interventionDate),1,4) = CURRENT_DATE()')
->where('Year(i.interventionDate) = YEAR(CURDATE()')
->where($qb->expr()->gt('i.interventionDate', 'CURRENT_TIMESTAMP()'))
->where('SUBSTRING(i.interventionDate), 1,4) = CURRENT_TIMESTAMP()')
感谢提前