Bläddra i källkod

Pages commandes backoffice

feature/export_comptable
Fab 4 år sedan
förälder
incheckning
9946b88dc0
1 ändrade filer med 22 tillägg och 3 borttagningar
  1. +22
    -3
      ShopBundle/Controller/Backend/OrderController.php

+ 22
- 3
ShopBundle/Controller/Backend/OrderController.php Visa fil

@@ -23,6 +23,26 @@ use Symfony\Component\HttpFoundation\Response;

class OrderController extends AdminController
{
protected function createListQueryBuilder($entityClass, $sortDirection, $sortField = null, $dqlFilter = null)
{
$filterOrderStatus = false;

dump($dqlFilter);
if ($dqlFilter['orderStatus'])$filterOrderStatus = $dqlFilter['orderStatus'];
$dqlFilter = $dqlFilter['filter'];

$queryBuilder = parent::createListQueryBuilder($entityClass, $sortDirection, $sortField, $dqlFilter);

$queryBuilder->leftJoin('entity.orderStatus','orderStatus');

if ($filterOrderStatus) {
$queryBuilder->andWhere('orderStatus.alias = :status');
$queryBuilder->setParameter('status', $filterOrderStatus);
}

return $queryBuilder;
}



public function updateEntity($entity)
@@ -344,7 +364,6 @@ class OrderController extends AdminController
public function renderOrderShopTemplate($actionName, $templatePath, array $parameters = [])
{
//dump($this->em->getRepository(OrderShop::class)->getValidOrder());

if ($actionName == 'show') {
$formAddProductToOrder = $this->createForm(AddPoductToOrderType::class, null, array(
'action' => $this->generateUrl('easyadmin', [
@@ -477,7 +496,7 @@ class OrderController extends AdminController
$id = $this->request->query->get('id');
$easyadmin = $this->request->attributes->get('easyadmin');
$entity = $easyadmin['item'];
$easyadmin['entity']['name'] = 'OrderShop';
$fields = $this->entity['show']['fields'];
$deleteForm = $this->createDeleteForm($this->entity['name'], $id);

@@ -495,7 +514,7 @@ class OrderController extends AdminController

];

return $this->executeDynamicMethod('render<EntityName>Template', ['show', $this->entity['templates']['show'], $parameters]);
return $this->executeDynamicMethod('renderOrderShopTemplate', ['show', $this->entity['templates']['show'], $parameters]);
}

/**

Laddar…
Avbryt
Spara