瀏覽代碼

Merge branch 'develop'

master
Fabien Normand 2 年之前
父節點
當前提交
9467343b6f
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      Controller/AbstractAdminController.php

+ 7
- 1
Controller/AbstractAdminController.php 查看文件

@@ -10,9 +10,11 @@ use EasyCorp\Bundle\EasyAdminBundle\Contracts\Controller\CrudControllerInterface
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto;
use EasyCorp\Bundle\EasyAdminBundle\Factory\ControllerFactory;
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField;
use Lc\CaracoleBundle\Container\Section\SectionContainer;
use Lc\CaracoleBundle\Doctrine\Extension\FilterMerchantInterface;
use Lc\CaracoleBundle\Doctrine\Extension\FilterSectionInterface;
use Lc\CaracoleBundle\Model\Section\SectionInterface;
use Lc\CaracoleBundle\Resolver\SectionResolver;
use Lc\SovBundle\Controller\AbstractAdminController as SovAbstractAdminController;
use Lc\SovBundle\Definition\ActionDefinition;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
@@ -38,7 +40,11 @@ abstract class AbstractAdminController extends SovAbstractAdminController
$repositoryQuery->filterIsOnlineAndOffline();
}
if ($this->isInstanceOf(FilterSectionInterface::class)) {
$repositoryQuery->filterBySection($this->getSectionCurrentDefault());
if($this->getSectionCurrent()){
$repositoryQuery->filterBySection($this->getSectionCurrent());
}else{
$repositoryQuery->filterBySection($this->get(SectionContainer::class)->getStore()->getOneDefault());
}
}

if ($this->isInstanceOf(FilterMerchantInterface::class)) {

Loading…
取消
儲存