Browse Source

Merge pull request #1740 from williamqian/dcat-admin-william

修复使用点语法的关联模型字段值无法导出的问题
Jiang Qinghua 2 years ago
parent
commit
a4f8439654
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/Grid/Exporters/AbstractExporter.php

+ 3 - 2
src/Grid/Exporters/AbstractExporter.php

@@ -217,11 +217,12 @@ abstract class AbstractExporter implements ExporterInterface
     /**
      * 格式化待导出数据.
      *
-     * @param  array  $data
+     * @param  Collection  $data
      * @return array
      */
     protected function normalize(Collection $data)
     {
+        $data = $data->toArray();
         foreach ($data as &$row) {
             $row = Arr::dot($row);
 
@@ -254,7 +255,7 @@ abstract class AbstractExporter implements ExporterInterface
     }
 
     /**
-     * @param  array  $data
+     * @param  Collection  $data
      * @return array
      */
     protected function callBuilder(Collection &$data)