This commit is contained in:
salam committed 2026-07-18 17:01:00 +02:00
1 parent 2be791d63b
commit 9e6f7e1c06
4 files changed
+8 -69

No files matched your search

+3 -11
View File
@@ -35,28 +35,20 @@ class Sofascore
break;
case 3:
TaskConfig::start();
break;
case 4:
DaysTournament::run();
break;
case 5:
case 4:
self::setStorage();
Grapper::load();
break;
case 6:
TaskConfig::end();
break;
case 7:
case 5:
self::setStorage();
ZipFolder::create(self::$storage);
break;
case 8:
case 6:
self::setStorage();
SendMail::run();
break;
@@ -1,28 +0,0 @@
<?php
namespace App\Console\Commands\Grapper\Sofascore\Helper;
use App\Console\Commands\Nuh;
use App\Models\SofaScoreTask;
use Illuminate\Support\Carbon;
class TaskConfig
{
public static function start()
{
$task_id = (int) Nuh::$options['task'] ?? 0;
SofaScoreTask::find($task_id)->update(['last_start' => Carbon::now()]);
}
public static function end()
{
$task_id = Nuh::$options['task'] ?? 0;
$res = SofaScoreTask::with('sport')->where('id', $task_id)->first();
if($res->run_repeatedly){
SofaScoreTask::query()->where('id', $task_id)->update(['compleated' => 1, 'is_active' => 1, 'last_end' => Carbon::now()]);
}
else {
SofaScoreTask::query()->where('id', $task_id)->update(['compleated' => 1, 'is_active' => 0, 'last_end' => Carbon::now()]);
}
}
}