瀏覽代碼

Fix

packProduct
Guillaume 3 年之前
父節點
當前提交
3429fb185f
共有 2 個文件被更改,包括 13 次插入1 次删除
  1. +1
    -1
      Controller/Site/PageAdminController.php
  2. +12
    -0
      Field/AssociationField.php

+ 1
- 1
Controller/Site/PageAdminController.php 查看文件

@@ -14,7 +14,7 @@ abstract class PageAdminController extends SovPageAdminController

public function createEntity(string $entityFqcn)
{
return $this->get(PageContainer::class)
return $this->getPageContainer()
->getFactory()
->setSection($this->get(SectionResolver::class)->getCurrent())
->create();

+ 12
- 0
Field/AssociationField.php 查看文件

@@ -71,6 +71,13 @@ final class AssociationField implements FieldInterface
return $this;
}

public function setFilterOnMerchantViaSection(MerchantInterface $merchant): self
{
$this->queryBuilderParameters['merchantViaSection'] = $merchant;

return $this;
}

public function setFilterOnDevAlias(string $devAlias): self
{
$this->queryBuilderParameters['devAlias'] = $devAlias;
@@ -129,6 +136,11 @@ final class AssociationField implements FieldInterface
$qb->andWhereMerchantManyToMany('e', $param['merchantManyToMany']);
}

if (isset($param['merchantViaSection'])) {
$qb->leftJoin('e.section', 's');
$qb->andWhereMerchant('s', $param['merchantViaSection']);
}

if (isset($param['status'])) {
$qb->andWhere('e.status = :status')->setParameter('status', $param['status']);
}

Loading…
取消
儲存