jqh 5 éve
szülő
commit
4c47ce6bf7

+ 2 - 5
src/Grid/Concerns/HasExporter.php

@@ -77,16 +77,13 @@ trait HasExporter
         return $this->exporter ?: ($this->exporter = new Exporter($this));
     }
 
-    /**
-     * @param string $gridName
-     */
-    public function setExporterQueryName($gridName)
+    public function setExporterQueryName()
     {
         if (! $this->allowExporter()) {
             return;
         }
 
-        $this->exporter()->setQueryName($gridName.'_export_');
+        $this->exporter()->setQueryName($this->getName().'_export_');
     }
 
     /**

+ 2 - 2
src/Grid/Concerns/HasNames.php

@@ -48,8 +48,8 @@ trait HasNames
             ->setSortName("{$name}_{$model->getSortName()}");
 
         $this->filter()->setName($name);
-        $this->setExporterQueryName($name);
-        $this->setQuickSearchQueryName($name);
+        $this->setExporterQueryName();
+        $this->setQuickSearchQueryName();
 
         return $this;
     }

+ 4 - 2
src/Grid/Concerns/HasQuickSearch.php

@@ -53,10 +53,12 @@ trait HasQuickSearch
     /**
      * @param string $gridName
      */
-    protected function setQuickSearchQueryName($gridName)
+    public function setQuickSearchQueryName()
     {
         if ($this->quickSearch) {
-            $this->quickSearch->setQueryName($gridName.'__search');
+            $this->quickSearch->setQueryName(
+                $this->getName().$this->quickSearch->queryName()
+            );
         }
     }
 

+ 2 - 0
src/Grid/Exporter.php

@@ -51,6 +51,8 @@ class Exporter
     public function __construct(Grid $grid)
     {
         $this->grid = $grid;
+
+        $grid->setExporterQueryName();
     }
 
     /**

+ 8 - 0
src/Grid/Tools/QuickSearch.php

@@ -3,6 +3,7 @@
 namespace Dcat\Admin\Grid\Tools;
 
 use Dcat\Admin\Admin;
+use Dcat\Admin\Grid;
 use Illuminate\Support\Arr;
 
 class QuickSearch extends AbstractTool
@@ -44,6 +45,13 @@ class QuickSearch extends AbstractTool
         return $this;
     }
 
+    public function setGrid(Grid $grid)
+    {
+        $grid->setQuickSearchQueryName();
+
+        return parent::setGrid($grid);
+    }
+
     /**
      * @return string
      */