瀏覽代碼

Merge branch 'develop'

master
Fabien Normand 3 年之前
父節點
當前提交
9a3c99fe00
共有 1 個檔案被更改,包括 6 行新增1 行删除
  1. +6
    -1
      Controller/Product/ProductFamilyAdminController.php

+ 6
- 1
Controller/Product/ProductFamilyAdminController.php 查看文件

@@ -8,6 +8,7 @@ use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
use Lc\CaracoleBundle\Container\Order\OrderShopContainer;
use Lc\CaracoleBundle\Container\Product\ProductFamilyContainer;
use Lc\CaracoleBundle\Controller\AbstractAdminController;
use Lc\CaracoleBundle\Definition\ActionDefinition;
use Lc\CaracoleBundle\Resolver\SectionResolver;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Symfony\Component\HttpFoundation\Response;
@@ -18,7 +19,11 @@ abstract class ProductFamilyAdminController extends AbstractAdminController
{
$crud = parent::configureCrud($crud);

$crud->setDefaultSort(['id' => 'DESC']);
if($this->getRequestCrudAction() === ActionDefinition::SORT) {
$crud->setDefaultSort(['position' => 'ASC']);
}else{
$crud->setDefaultSort(['id' => 'DESC']);
}

return $crud;
}

Loading…
取消
儲存