我想使用以下查询来排序商店下订单的日期.我想按升序执行它们但是当我尝试测试运行时,我收到以下错误:
[Syntax Error] line 0, col 7: Error: Expected IdentificationVariable |
ScalarExpression | AggregateExpression | FunctionDeclaration |
PartialObjectExpression | “(” Subselect “)” | CaseExpression, got
‘order’
$orderSales = $this->getDoctrine()->getRepository("AppBundle:Order")->createQueryBuilder('order');
$orderSales->orderBy('order.date', 'asc');
$orderSales = $orderSales->getQuery();
$orderResult = $orderSales->getResult();
我在.twig模板中渲染orderResult
return $this->render('admin/store/sales/adminsales.html.twig', array(
'orderResult' =>$orderResult
));