fix import events
This commit is contained in:
1 parent
8578ec96bb
commit
7665da190c
2 files changed
+28
-14
No files matched your search
@@ -18,8 +18,6 @@ class Tournament
|
||||
{
|
||||
public static function load()
|
||||
{
|
||||
$days = 1;
|
||||
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
|
||||
$force = Nuh::$options['f'] ?? 0;
|
||||
@@ -28,11 +26,9 @@ class Tournament
|
||||
|
||||
$sport = Sport::where('id', $sport_id)->first();
|
||||
|
||||
// start yesterday
|
||||
$grapping_date = Carbon::now()->subDay();
|
||||
$_days = self::days($sport);
|
||||
|
||||
$days++;
|
||||
$days_back = Carbon::now()->subDays($days);
|
||||
dd($_days);
|
||||
|
||||
while ($grapping_date >= $days_back) {
|
||||
|
||||
@@ -179,4 +175,22 @@ class Tournament
|
||||
$grapping_date->subDay();
|
||||
}
|
||||
}
|
||||
|
||||
public static function days(Sport $sport)
|
||||
{
|
||||
$d = Carbon::now()->subDay();
|
||||
Notice::note($d->format('d. m. Y'), 'b');
|
||||
|
||||
$loop = true;
|
||||
while ($loop) {
|
||||
if (!SofaScoreDay::where('day', $d)->first()) {
|
||||
// SofaScoreDay::insert(['day' => $d]);
|
||||
$d->subDay();
|
||||
} else {
|
||||
$loop = false;
|
||||
}
|
||||
Notice::note($d->format('d. m. Y'), 'g');
|
||||
}
|
||||
return SofaScoreDay::where($sport->ss_slug, 0)->get();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user