This commit is contained in:
salam committed 2026-08-03 09:32:32 +02:00
1 parent 86115ac9e8
commit a85ac159de
3 files changed
+31 -36

No files matched your search

@@ -6,13 +6,13 @@ use App\Console\Commands\Grapper\Sofascore;
use App\Console\Commands\Grapper\Sofascore\Helper\ZipFolder;
use App\Console\Commands\Nuh;
use App\Utilities\Notice;
use Illuminate\Support\Carbon;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
class MakeExcel
{
public static $FOLDER = 'Season-25-26-Major-Leagues';
public static $MAXCOLUMNS = 1000;
public static $max = 1000;
public static function create()
{
@@ -21,21 +21,17 @@ class MakeExcel
$debug = Nuh::$options['d'] ?? 0;
if ($debug) {
Notice::note("Make Excel", 'bb');
}
if ($debug) {
Notice::note("Folder to Import: " . self::$FOLDER . "\nMaximum in Excel: " . self::$MAXCOLUMNS, 'b');
Notice::note("Make Excel folder to import: " . Sofascore::$folder . "\nmaximum files in excel: " . self::$max, 'b');
}
$files = self::load_files();
foreach ($files as $key => $value) {
$from = $key * self::$MAXCOLUMNS + 1;
$from = $key * self::$max + 1;
$key++;
$to = $key * self::$MAXCOLUMNS;
$filename = self::$FOLDER . '-' . $from . '-' . $to . '.xlsx';
$to = $key * self::$max;
$filename = Sofascore::$folder . '-' . $from . '-' . $to . '.xlsx';
$spreadsheet = new Spreadsheet;
$spreadsheet->getProperties()->setTitle($filename);
@@ -65,7 +61,7 @@ class MakeExcel
public static function load_files()
{
$files = ZipFolder::get_tree(Sofascore::$storage . '/' . self::$FOLDER);
$files = ZipFolder::get_tree(Sofascore::$storage . '/' . Sofascore::$folder);
$filtered = [];
foreach ($files as $file) {
@@ -74,7 +70,6 @@ class MakeExcel
$filtered[] = $file;
}
}
return array_chunk($filtered, self::$MAXCOLUMNS);
return array_chunk($filtered, self::$max);
}
}