From: soufiane Date: Wed, 14 Feb 2024 17:20:21 +0000 (+0100) Subject: wait #6717 @0:30 ajout de données dans l'excel X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=59668d7c633fba354ba4f82583f4e309522fa661;p=fluidbook-toolbox.git wait #6717 @0:30 ajout de données dans l'excel --- diff --git a/app/Console/Commands/FluidbookSettingsExport.php b/app/Console/Commands/FluidbookSettingsExport.php index d81c8e7e7..d702e7875 100644 --- a/app/Console/Commands/FluidbookSettingsExport.php +++ b/app/Console/Commands/FluidbookSettingsExport.php @@ -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');