wip
This commit is contained in:
1 parent
f028a8b2a8
commit
60ab054eb2
5 files changed
+18
-16
No files matched your search
@@ -10,13 +10,13 @@ use App\Console\Commands\Grapper\Sofascore\Rose;
|
||||
use App\Console\Commands\Grapper\Sofascore\SendMail;
|
||||
use App\Console\Commands\Grapper\Sofascore\SettingsToLocal;
|
||||
use App\Console\Commands\Grapper\Sofascore\SqlMover;
|
||||
use App\Traits\UpdatePlayerSeasonHelper;
|
||||
use App\Traits\UpdateHelper;
|
||||
use App\Utilities\Notice;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class Grap extends Command
|
||||
{
|
||||
use UpdatePlayerSeasonHelper;
|
||||
use UpdateHelper;
|
||||
|
||||
public static $options = [];
|
||||
|
||||
|
||||
@@ -2,19 +2,21 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Traits\UpdatePlayerSeasonHelper;
|
||||
use App\Traits\UpdateHelper;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class Upd extends Command
|
||||
{
|
||||
use UpdatePlayerSeasonHelper;
|
||||
use UpdateHelper;
|
||||
|
||||
protected $signature = 'upd {--d}';
|
||||
protected $signature = 'update:player {--d}';
|
||||
|
||||
protected $description = 'update sofa_score_player_per_seasons';
|
||||
|
||||
public function handleUpdate(int $playerCount): void
|
||||
{
|
||||
$this->update($playerCount);
|
||||
// Have fun running imports here
|
||||
// Examples can be found in the ImportHelper trait
|
||||
$this->updatePlayers($playerCount);
|
||||
}
|
||||
}
|
||||
@@ -3,14 +3,14 @@
|
||||
namespace App\Filament\Imports\Helper;
|
||||
|
||||
use App\Models\StatistikoDetail;
|
||||
use App\Traits\UpdatePlayerSeasonHelper;
|
||||
use App\Traits\UpdateHelper;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
use Spatie\SimpleExcel\SimpleExcelReader;
|
||||
|
||||
class ImportDetails
|
||||
{
|
||||
use UpdatePlayerSeasonHelper;
|
||||
use UpdateHelper;
|
||||
|
||||
public static function run(string $filePath): void
|
||||
{
|
||||
@@ -64,6 +64,6 @@ class ImportDetails
|
||||
StatistikoDetail::where('updated_at', '!=', $now)->update(['is_active' => 0]);
|
||||
|
||||
/**update statistic player tabel */
|
||||
UpdatePlayerSeasonHelper::update(1000000);
|
||||
UpdateHelper::updatePlayers(1000000);
|
||||
}
|
||||
}
|
||||
@@ -3,13 +3,13 @@
|
||||
namespace App\Filament\Imports\Helper;
|
||||
|
||||
use App\Models\StatistikoPlayer;
|
||||
use App\Traits\UpdatePlayerSeasonHelper;
|
||||
use App\Traits\UpdateHelper;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
use Spatie\SimpleExcel\SimpleExcelReader;
|
||||
|
||||
class ImportPlayer
|
||||
{
|
||||
use UpdatePlayerSeasonHelper;
|
||||
use UpdateHelper;
|
||||
|
||||
public static function run(string $filePath): void
|
||||
{
|
||||
@@ -117,6 +117,6 @@ class ImportPlayer
|
||||
});
|
||||
|
||||
/**update statistic player tabel */
|
||||
UpdatePlayerSeasonHelper::update(1000000);
|
||||
UpdateHelper::updatePlayers(1000000);
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ use PDOStatement;
|
||||
|
||||
use function Laravel\Prompts\select;
|
||||
|
||||
trait UpdatePlayerSeasonHelper
|
||||
trait UpdateHelper
|
||||
{
|
||||
protected float $benchmarkStartTime;
|
||||
|
||||
@@ -26,7 +26,7 @@ trait UpdatePlayerSeasonHelper
|
||||
|
||||
protected int $debug;
|
||||
|
||||
public function handleUpdate(): void
|
||||
public function handle(): void
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
@@ -49,7 +49,7 @@ trait UpdatePlayerSeasonHelper
|
||||
}
|
||||
|
||||
try {
|
||||
$this->update($playerCount);
|
||||
$this->updatePlayers($playerCount);
|
||||
} catch (\Exception $e) {
|
||||
$this->error(get_class($e).' '.Str::of($e->getMessage())->limit(100)->value());
|
||||
}
|
||||
@@ -115,7 +115,7 @@ trait UpdatePlayerSeasonHelper
|
||||
$this->newLine();
|
||||
}
|
||||
|
||||
protected function update(int $playerCount)
|
||||
protected function updatePlayers(int $playerCount)
|
||||
{
|
||||
$res_player = StatistikoDetail::query()->where('is_active', 1)->limit($playerCount)->pluck('ss_player_id')->toArray();
|
||||
|
||||
Reference in new issue
Block a user