]> _ Git - fluidbook-toolbox.git/commitdiff
wait #6717 @0:30 ajout de données dans l'excel
authorsoufiane <soufiane@cubedesigners.com>
Wed, 14 Feb 2024 17:20:21 +0000 (18:20 +0100)
committersoufiane <soufiane@cubedesigners.com>
Wed, 14 Feb 2024 17:20:21 +0000 (18:20 +0100)
app/Console/Commands/FluidbookSettingsExport.php

index d81c8e7e7a935a8b73f4463e8fc08575d6e5a37b..d702e78755a52cae9889c5c466cfbdd5b9d29b9f 100644 (file)
@@ -43,9 +43,10 @@ class FluidbookSettingsExport extends ToolboxCommand
         $listID = ArrayUtil::parseRange($this->argument('id'));
         $model = FluidbookPublication::whereIn('id',$listID);
 
-        $settings = $model->get()->map(function($i){
-            $extraFields = ["#" => $i->id];
-            return array_merge($extraFields,json_decode($i->settings, true));
+        $all = $model->get()->toArray();
+        $settings = $model->get()->map(function($i,$k) use($all){
+            unset($all[$k]['settings']);
+            return array_merge($all[$k],json_decode($i->settings, true));
         })->toArray();
 
         $fields = $model->get()->map(function($i) {
@@ -55,7 +56,7 @@ class FluidbookSettingsExport extends ToolboxCommand
         //$editable = ['type' => 'text', 'editable' => true];
         $noteditable = ['type' => 'noteditable', 'editable' => false];
 
-        $field = ['#' => $noteditable];
+        $field = ['id' => $noteditable];
         foreach ($fields as $key => $f) {
             foreach ($f as $k => $g) {
                 $name = $g->getAttribute('name');