list = []; foreach ($dataList as $key => $value) { if ($key >= 2) { if (isset($value['bq_meeting']) && $value['bq_meeting'] == 1) { $this->list[] = 'F' . ($key + 1); } if (isset($value['home_page_adjustment']) && $value['home_page_adjustment'] == 1) { $this->list[] = 'G' . ($key + 1); } if (isset($value['product_series_page_adjustment']) && $value['product_series_page_adjustment'] == 1) { $this->list[] = 'H' . ($key + 1); } if (isset($value['other_page_adjustments']) && $value['other_page_adjustments'] == 1) { $this->list[] = 'I' . ($key + 1); } if (isset($value['code_adjustment']) && $value['code_adjustment'] == 1) { $this->list[] = 'J' . ($key + 1); } if (isset($value['web_page_adjustment']) && $value['web_page_adjustment'] == 1) { $this->list[] = 'K' . ($key + 1); } if (isset($value['website_seo_quality_inspection']) && $value['website_seo_quality_inspection'] == 1) { $this->list[] = 'L' . ($key + 1); } if (isset($value['small_language_station']) && $value['small_language_station'] == 1) { $this->list[] = 'M' . ($key + 1); } $dataList[$key]['bq_meeting'] = '百千会议'; $dataList[$key]['home_page_adjustment'] = '首页调整'; $dataList[$key]['product_series_page_adjustment'] = '产品系列页面调整'; $dataList[$key]['other_page_adjustments'] = '其他页面调整'; $dataList[$key]['code_adjustment'] = '代码调整'; $dataList[$key]['web_page_adjustment'] = '网页调整'; $dataList[$key]['website_seo_quality_inspection'] = '网站SEO质检'; $dataList[$key]['small_language_station'] = '小语言站'; } } $this->dataList = $dataList; } public function array(): array { return $this->dataList; } public function registerEvents(): array { return [ AfterSheet::class => function (AfterSheet $event) { $cells = ['A1:M1']; $this->setCellWidth($event, $cells); $cells[] = 'A2:M2'; $this->setCellColor($cells, $event);//表头 $this->setCellColorBorders($cells, $event); $this->setCellColor($this->list, $event, '87CEFA'); } ]; } }