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()]);
}
}
}
@@ -23,32 +23,13 @@ class SofaScoreTasksTable
->width(30)
->icon(fn($record) => $record->sport->icon),
TextColumn::make('sport.name'),
IconColumn::make('compleated')
->width('1rem')
->label('Status')
->alignCenter()
->icon(fn(string $state): string => match ($state) {
'0' => 'phosphor-pause-fill',
'1' => 'phosphor-check-fat-fill',
})
->color(fn(string $state): string => match ($state) {
'0' => 'gray',
'1' => 'success',
}),
TextColumn::make('mode')
->label('Grapping dates')
->formatStateUsing(fn(string $state, $record): string => match ($state) {
'auto_updater' => 'Last 3 days',
'auto_updater' => 'Yesterday',
'date' => $record->day_from,
'range' => $record->day_from . ' <=> ' . $record->day_to,
}),
ToggleColumn::make('is_active')
->alignCenter()
->afterStateUpdated(function ($record) {
SofaScoreTask::where('id', $record->id)->update(['compleated' => 0]);
}),
ToggleColumn::make('run_repeatedly')->alignCenter(),
TextColumn::make('duration'),
])
->filters([
//
+4 -10
View File
@@ -29,23 +29,17 @@ case "$1" in
# echo "\n⚽ close vpn"
# killall ssh
# echo "\n⚽ TaskConfig start"
php artisan nuh --d --f 67 --fun=3 --task=$1
# echo "\n⚽ Days Tournament"
# php artisan nuh --d --f 67 --fun=4 --task=$1
# php artisan nuh --d --f 67 --fun=3 --task=$1
# echo "\n⚽ Grapper"
# php artisan nuh --d --f 67 --fun=5 --task=$1
# echo "\n⚽ TaskConfig end"
# php artisan nuh --d --f 67 --fun=6 --task=$1
# php artisan nuh --d --f 67 --fun=4 --task=$1
# echo "\n⚽ CreateZip"
# php artisan nuh --d --f 67 --fun=7 --task=$1
# php artisan nuh --d --f 67 --fun=5 --task=$1
# echo "\n⚽ SendMail"
# php artisan nuh --d --f 67 --fun=8 --task=$1
# php artisan nuh --d --f 67 --fun=6 --task=$1
echo "\n😎 done :)"
;;