我被困在这里,我花了最后2天解决这个问题,但失败了.我正在我的存储库中编写一个查询来获取当月的条目.这是我的查询: -
$this->getEntityManager()
->createQuery('SELECT count(a) FROM CollegeStudentBundle:StudentAttendance a where a.student_id='.$id.'
and a.date > DATE_SUB(CURRENT_TIMESTAMP(),INTERVAL 1 MONTH)')
Run Code Online (Sandbox Code Playgroud)
当我尝试运行它时,它给了我一个错误
[Syntax Error] line 0, col 133: Error: Expected Doctrine\ORM\Query\Lexer::T_COMMA, got '1'
Run Code Online (Sandbox Code Playgroud)
即使我尝试过这件事,但没有帮助我.