43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Exports;
|
||
|
|
|
||
|
|
use App\Exports\Sheets\LoveIncomDetail;
|
||
|
|
use App\Exports\Sheets\LoveIncome;
|
||
|
|
use App\Exports\Sheets\SaasIncome;
|
||
|
|
use App\Exports\Sheets\SaasLoveIncome;
|
||
|
|
use Maatwebsite\Excel\Concerns\FromCollection;
|
||
|
|
use Maatwebsite\Excel\Concerns\WithMultipleSheets;
|
||
|
|
|
||
|
|
class ReportFormExport implements WithMultipleSheets
|
||
|
|
{
|
||
|
|
protected $start_date, $end_date;
|
||
|
|
public function __construct($start_date)
|
||
|
|
{
|
||
|
|
$this->start_date = date('Y-m-d', strtotime($start_date));
|
||
|
|
$this->end_date = date("Y-m-d", strtotime('next month', strtotime($start_date)));
|
||
|
|
}
|
||
|
|
// /**
|
||
|
|
// * @return \Illuminate\Support\Collection
|
||
|
|
// */
|
||
|
|
// public function collection()
|
||
|
|
// {
|
||
|
|
//
|
||
|
|
// }
|
||
|
|
|
||
|
|
public function sheets(): array
|
||
|
|
{
|
||
|
|
$sheets = [
|
||
|
|
//福恋收入明细
|
||
|
|
new SaasLoveIncome($this->start_date,$this->end_date),
|
||
|
|
//Saas收入明细
|
||
|
|
new SaasIncome($this->start_date, $this->end_date),
|
||
|
|
//福恋小程序会员汇总
|
||
|
|
new LoveIncome($this->start_date, $this->end_date),
|
||
|
|
//福恋小程序会员明细
|
||
|
|
new LoveIncomDetail($this->start_date, $this->end_date)
|
||
|
|
];
|
||
|
|
return $sheets;
|
||
|
|
}
|
||
|
|
}
|