31 lines
819 B
PHP
31 lines
819 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Exports;
|
||
|
|
|
||
|
|
use App\Exports\Sheets\LoveIncome;
|
||
|
|
use App\Exports\Sheets\SaasIncome;
|
||
|
|
|
||
|
|
class StatementExportV2 implements \Maatwebsite\Excel\Concerns\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)));
|
||
|
|
}
|
||
|
|
/**
|
||
|
|
* @inheritDoc
|
||
|
|
*/
|
||
|
|
public function sheets(): array
|
||
|
|
{
|
||
|
|
// TODO: Implement sheets() method.
|
||
|
|
$sheets = [
|
||
|
|
//Saas收入明细
|
||
|
|
new SaasIncome($this->start_date, $this->end_date),
|
||
|
|
//福恋产品收入明细
|
||
|
|
new LoveIncome($this->start_date,$this->end_date),
|
||
|
|
];
|
||
|
|
return $sheets;
|
||
|
|
}
|
||
|
|
}
|