Преглед изворни кода

Pages commandes backoffice

feature/export_comptable
Fab пре 4 година
родитељ
комит
9946b88dc0
1 измењених фајлова са 22 додато и 3 уклоњено
  1. +22
    -3
      ShopBundle/Controller/Backend/OrderController.php

+ 22
- 3
ShopBundle/Controller/Backend/OrderController.php Прегледај датотеку

@@ -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]);
}

/**

Loading…
Откажи
Сачувај