love_php/app/Exports/LiveLogData.php

34 lines
775 B
PHP
Raw Normal View History

2026-04-02 09:20:51 +08:00
<?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;
}
}