wip
This commit is contained in:
1 parent
2be791d63b
commit
9e6f7e1c06
4 files changed
+8
-69
No files matched your search
@@ -35,28 +35,20 @@ class Sofascore
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
TaskConfig::start();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
DaysTournament::run();
|
DaysTournament::run();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 4:
|
||||||
self::setStorage();
|
self::setStorage();
|
||||||
Grapper::load();
|
Grapper::load();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 5:
|
||||||
TaskConfig::end();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 7:
|
|
||||||
self::setStorage();
|
self::setStorage();
|
||||||
ZipFolder::create(self::$storage);
|
ZipFolder::create(self::$storage);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 6:
|
||||||
self::setStorage();
|
self::setStorage();
|
||||||
SendMail::run();
|
SendMail::run();
|
||||||
break;
|
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()]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-20
@@ -23,32 +23,13 @@ class SofaScoreTasksTable
|
|||||||
->width(30)
|
->width(30)
|
||||||
->icon(fn($record) => $record->sport->icon),
|
->icon(fn($record) => $record->sport->icon),
|
||||||
TextColumn::make('sport.name'),
|
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')
|
TextColumn::make('mode')
|
||||||
->label('Grapping dates')
|
->label('Grapping dates')
|
||||||
->formatStateUsing(fn(string $state, $record): string => match ($state) {
|
->formatStateUsing(fn(string $state, $record): string => match ($state) {
|
||||||
'auto_updater' => 'Last 3 days',
|
'auto_updater' => 'Yesterday',
|
||||||
'date' => $record->day_from,
|
'date' => $record->day_from,
|
||||||
'range' => $record->day_from . ' <=> ' . $record->day_to,
|
'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([
|
->filters([
|
||||||
//
|
//
|
||||||
|
|||||||
+4
-10
@@ -29,23 +29,17 @@ case "$1" in
|
|||||||
# echo "\n⚽ close vpn"
|
# echo "\n⚽ close vpn"
|
||||||
# killall ssh
|
# killall ssh
|
||||||
|
|
||||||
# echo "\n⚽ TaskConfig start"
|
|
||||||
php artisan nuh --d --f 67 --fun=3 --task=$1
|
|
||||||
|
|
||||||
# echo "\n⚽ Days Tournament"
|
# 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"
|
# echo "\n⚽ Grapper"
|
||||||
# php artisan nuh --d --f 67 --fun=5 --task=$1
|
# php artisan nuh --d --f 67 --fun=4 --task=$1
|
||||||
|
|
||||||
# echo "\n⚽ TaskConfig end"
|
|
||||||
# php artisan nuh --d --f 67 --fun=6 --task=$1
|
|
||||||
|
|
||||||
# echo "\n⚽ CreateZip"
|
# 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"
|
# 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 :)"
|
echo "\n😎 done :)"
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in new issue
Block a user