Oro Doctrine Extensions 라이브러리의 Doctrine 및 TIMESTAMPDIFF
함수에 대한 것입니다.예상되는 Doctrine ORM Query Lexer :: T_CLOSE_PARENTHESIS, ','
일부 코드 :
$qb = $em->createQueryBuilder();
$totalLogedTime = $qb
->select('SUM(TIMESTAMPDIFF(MINUTE, ulr.logedIn, ulr.logedOut)) as sum')
->from('SDUserBundle:UserLoginRecord', 'ulr')
->where ...
config.yml
dql:
string_functions:
array_to_string: ITDoors\CommonBundle\DQL\ArrayToStringDQL
array: ITDoors\CommonBundle\DQL\ArrayDQL
select_next_handling_message_date: SD\CommonBundle\DQL\SelectNextHandlingMessageDateDQL
cast: Oro\ORM\Query\AST\Functions\Cast
datetime_functions:
date: Oro\ORM\Query\AST\Functions\SimpleFunction
numeric_functions:
dayofyear: Oro\ORM\Query\AST\Functions\SimpleFunction
year: Oro\ORM\Query\AST\Functions\SimpleFunction
month: Oro\ORM\Query\AST\Functions\SimpleFunction
day: Oro\ORM\Query\AST\Functions\SimpleFunction
timestampdiff: Oro\ORM\Query\AST\Functions\SimpleFunction
date: Oro\ORM\Query\AST\Functions\SimpleFunction
오류 :
[Syntax Error] line 0, col 31: Error: Expected Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS, got ','
DQL :
SELECT SUM(TIMESTAMPDIFF(MINUTE, ulr.logedIn, ulr.logedOut)) FROM SDUserBundle:UserLoginRecord ulr WHERE ulr.user_id = 353 AND ulr.logedIn > :start AND ulr.logedOut < :end
^- col 31
뭐가 잘못 됐니? 감사.
전체 DQL을 제공 할 수 있습니까? –
이'die ($ qb-> getDql()); '을 실행하면 전체 DQL을 볼 수 있거나 프로파일 러에서 전체 DQL을 볼 수 있습니다. 'select' 함수가 포함하는 것은 결과 DQL이 될 수있는 것과 같지 않습니다 – sjagr
질의를위한 DQL,'config.yml'의 전체'dql' 매개 변수가 없습니다 – sjagr