芝麻web文件管理V1.00
编辑当前文件:/home/forge/stage.herta-bht.smartcon-survey.com/app/Exports/ImageStatementExport.php
data = $data['data']; $this->country = $country; } public function array(): array { $rows = []; // Iterate through each statement in data foreach ($this->data as $statement) { $text = $statement['text']; $lastValues = $statement['values']['last']; $currentValues = $statement['values']['current']; foreach ($lastValues as $value) { $rows[] = [ 'Country' => $this->country->name, 'Brand' => $value['brand']->name, 'Quarter' => $value['label'], 'Text' => $text, '%' => (string) $value['value'], 'n' => (string) $value['n'], ]; } foreach ($currentValues as $value) { $rows[] = [ 'Country' => $this->country->name, 'Brand' => $value['brand']->name, 'Quarter' => $value['label'], 'Text' => $text, '%' => (string) $value['value'], 'n' => (string) $value['n'], ]; } } return $rows; } public function headings(): array { return [ 'Country', 'Brand', 'Quarter', 'Image Statement', '%', 'n', ]; } public function columnFormats(): array { return [ 'G' => NumberFormat::FORMAT_NUMBER, // Format 'Value' column as number ]; } }