wip
This commit is contained in:
1 parent
acf1b78c47
commit
03b3d47151
7 files changed
+129
-34
No files matched your search
@@ -4,9 +4,10 @@ namespace App\Traits\Sofascore;
|
||||
|
||||
use App\Models\SofaScoreTask;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
trait GrappingToExcel
|
||||
{
|
||||
@@ -26,15 +27,23 @@ trait GrappingToExcel
|
||||
case 'daily':
|
||||
$directories = File::directories($this->data_dir);
|
||||
foreach ($directories as $directory) {
|
||||
$day = substr(strrchr($directory, "/"), 1);
|
||||
$this->titel = ucfirst($folder) . '-' . $day;
|
||||
$this->make_file($this->data_dir . '/' . $day);
|
||||
$day = substr(strrchr($directory, '/'), 1);
|
||||
$this->titel = ucfirst($folder).'-'.$day;
|
||||
$this->make_file($this->data_dir.'/'.$day);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'range':
|
||||
$task = SofaScoreTask::with('sport')->where('id', 3)->first();
|
||||
$this->titel = ucfirst($folder) . '-' . $this->clean_string($task->name);
|
||||
$this->titel = ucfirst($folder).'-'.$this->clean_string($task->name);
|
||||
$this->make_file($this->data_dir);
|
||||
break;
|
||||
|
||||
case 'rose_major':
|
||||
case 'rose_others':
|
||||
$day = Carbon::now()->subDay()->format('Y-m-d');
|
||||
|
||||
$this->titel = ucfirst($folder).'-'.$day;
|
||||
$this->make_file($this->data_dir);
|
||||
break;
|
||||
}
|
||||
@@ -67,7 +76,7 @@ trait GrappingToExcel
|
||||
}
|
||||
|
||||
$spreadsheet = new Spreadsheet;
|
||||
$spreadsheet->getProperties()->setTitle($this->titel . '-' . $count_from . '-' . $count_to);
|
||||
$spreadsheet->getProperties()->setTitle($this->titel.'-'.$count_from.'-'.$count_to);
|
||||
$activeWorksheet = $spreadsheet->getActiveSheet();
|
||||
|
||||
$column = 1;
|
||||
|
||||
Reference in new issue
Block a user