34 lines
775 B
PHP
34 lines
775 B
PHP
<?php
|
|
|
|
namespace App\Exports;
|
|
|
|
use App\User;
|
|
use Maatwebsite\Excel\Concerns\FromCollection;
|
|
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
|
|
use Maatwebsite\Excel\Concerns\Exportable;
|
|
|
|
class LiveLogData implements WithMultipleSheets
|
|
{
|
|
use Exportable;
|
|
protected $data;
|
|
public function __construct($data)
|
|
{
|
|
$this->data = $data;
|
|
}
|
|
|
|
public function sheets(): array
|
|
{
|
|
$sheets = [];
|
|
$arr = [];
|
|
foreach ($this->data as $data) {
|
|
$log_arr = $data['log_arr'];
|
|
$sheets[] = new \App\Exports\LiveLogDataV2($log_arr,$data['live_id'].'号直播间记录');
|
|
unset($data['log_arr']);
|
|
$arr[] = $data;
|
|
}
|
|
|
|
array_unshift($sheets, new \App\Exports\LiveLogDataV3($arr));
|
|
return $sheets;
|
|
}
|
|
|
|
} |