wip
This commit is contained in:
1 parent
254ca94d73
commit
eb4499efe5
5 files changed
+22
-22
No files matched your search
@@ -135,7 +135,7 @@ trait GrapSofascore
|
||||
/**
|
||||
* day 5
|
||||
*/
|
||||
// $this->clear_folder($folder, 'data');
|
||||
$this->clear_folder($folder, 'data');
|
||||
|
||||
$day = Carbon::now()->subDays(5)->format('Y-m-d');
|
||||
|
||||
@@ -214,9 +214,7 @@ trait GrapSofascore
|
||||
}
|
||||
}
|
||||
|
||||
Notice::note('Excel', 'g');
|
||||
|
||||
$this->import_to_excel($folder, $day);
|
||||
$this->import_to_excel($folder);
|
||||
|
||||
Notice::note('Done', 'g');
|
||||
}
|
||||
|
||||
@@ -216,13 +216,9 @@ trait GrappingHelper
|
||||
}
|
||||
|
||||
/**
|
||||
* a Grap --d --f 67 --fun=4 --task=1
|
||||
* Summary of grap_tournaments_for_day
|
||||
*
|
||||
* Ita Serie-A-Saison 23-08-2025 - 24-05-2026
|
||||
* Ger Bundesliga 22-08-2025 – 16-05-2026
|
||||
* Eng Premier league 15-08-2025 - 24-05-2026
|
||||
* Spa La Liga 15-08-2025 - 24-05-2026
|
||||
* Fra Liggue 15-08-2025 - 17-05-2026
|
||||
* @return void
|
||||
*/
|
||||
protected function grap_tournaments_for_day(string $day)
|
||||
{
|
||||
@@ -248,7 +244,7 @@ trait GrappingHelper
|
||||
while ($page) {
|
||||
// $data = $this->curl($url);
|
||||
|
||||
$this->sleep(1);
|
||||
$this->sleep();
|
||||
|
||||
$url = $this->base_url."api/v1/sport/$slug/scheduled-tournaments/$day/page/$page";
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ trait GrappingMail
|
||||
ini_set('memory_limit', -1);
|
||||
|
||||
if ($this->debug) {
|
||||
Notice::note("Eend excel files from folder $folder", 'b');
|
||||
Notice::note("Mail Excel: $folder", 'b');
|
||||
}
|
||||
|
||||
$files = $this->get_tree("$this->data_dir/$folder");
|
||||
$files = $this->get_tree($this->data_dir);
|
||||
|
||||
$sendfiles = $this->filter($files, ['xlsx']);
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace App\Traits\Sofascore;
|
||||
|
||||
use App\Models\SofaScoreTask;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Support\Carbon;
|
||||
use PhpOffice\PhpSpreadsheet\IOFactory;
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
|
||||
@@ -21,14 +21,19 @@ trait GrappingToExcel
|
||||
Notice::note("import $folder to excel", 'g');
|
||||
}
|
||||
|
||||
$this->titel = ucfirst($folder);
|
||||
if (! $day) {
|
||||
$this->titel .= '_'.Carbon::now()->format('Y-m-d');
|
||||
} else {
|
||||
$this->titel .= "_$day";
|
||||
}
|
||||
switch ($this->task_id) {
|
||||
case 1:
|
||||
$this->titel .= ucfirst($folder).'_'.$day;
|
||||
|
||||
$files = $this->get_tree($this->data_dir);
|
||||
$files = $this->get_tree($this->data_dir.'/'.$day);
|
||||
|
||||
break;
|
||||
case 3:
|
||||
$task = SofaScoreTask::with('sport')->where('id', $this->task_id)->first();
|
||||
$this->titel = ucfirst($folder).'-'.$this->clean_string($task->name);
|
||||
$files = $this->get_tree($this->data_dir);
|
||||
break;
|
||||
}
|
||||
|
||||
$files = array_chunk($this->filter($files), $this->max);
|
||||
|
||||
@@ -74,7 +79,7 @@ trait GrappingToExcel
|
||||
|
||||
$spreadsheet->setActiveSheetIndex(0);
|
||||
$writer = IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||
$writer->save("$this->data_dir/$folder/$this->titel-$count_from-$count_to.xlsx");
|
||||
$writer->save("$this->data_dir/$this->titel-$count_from-$count_to.xlsx");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user