@@ -29,6 +29,7 @@ class TicketFieldDefinition extends SovTicketFieldDefinition | |||
return array_merge(parent::configureFields(), [ | |||
'type' => ChoiceField::new('type') | |||
->autocomplete() | |||
->setSortable(true) | |||
->setChoices( | |||
$this->translatorAdmin->transChoices( | |||
TicketSolver::getTypeChoices(), |
@@ -5,6 +5,7 @@ namespace Lc\CaracoleBundle\Field\Filter; | |||
use Doctrine\ORM\EntityRepository; | |||
use Doctrine\ORM\QueryBuilder; | |||
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; | |||
use Lc\ShopBundle\Context\TreeInterface; | |||
use Lc\SovBundle\Field\Filter\AssociationFilter; | |||
use Lc\SovBundle\Field\Filter\FilterTrait; | |||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||
@@ -43,7 +44,12 @@ class ProductCategoriesFilter extends AssociationFilter | |||
{ | |||
$fieldProperty = $this->getFieldProperty($fieldDto); | |||
if ($filteredValue !== null) { | |||
$repositoryQuery->filterByProductCategory($filteredValue); | |||
if ($filteredValue->getParent() == null) { | |||
$param = array_merge(array($filteredValue), $filteredValue->getChildrens()->toArray()); | |||
} else { | |||
$param = array($filteredValue); | |||
} | |||
$repositoryQuery->filterByProductCategoryArray($param); | |||
} | |||
} |
@@ -104,6 +104,14 @@ class ProductFamilyRepositoryQuery extends AbstractRepositoryQuery | |||
->setParameter('category', $category->getId()); | |||
} | |||
public function filterByProductCategoryArray(Array $categoryArray): self | |||
{ | |||
$this->joinProductCategories(); | |||
return $this | |||
->andWhere(':categoryArray MEMBER OF .productCategories') | |||
->setParameter('categoryArray', $categoryArray); | |||
} | |||
public function filterByPropertyNoveltyExpirationDate($dateTime = null): self | |||
{ |
@@ -45,7 +45,7 @@ class ProductStore extends AbstractStore | |||
$query->joinProductFamily(); | |||
$query->filterIsOnline(); | |||
$query->filterAvailableQuantityNegative(); | |||
$query->groupBy('pf.id'); | |||
$query->groupBy('productFamily.id'); | |||
$productListAvailableQuantityNegative = $query->find(); | |||
foreach ($productListAvailableQuantityNegative as $i=>$product) { | |||
@@ -62,7 +62,7 @@ class ProductStore extends AbstractStore | |||
$query->joinProductFamily(); | |||
$query->filterIsOnline(); | |||
$query->filterAvailableQuantitySupplierNegative(); | |||
$query->groupBy('pf.id'); | |||
$query->groupBy('productFamily.id'); | |||
$productListAvailableQuantityNegative = $query->find(); | |||
foreach ($productListAvailableQuantityNegative as $i=>$product) { |