tag and installer&updater use english

This commit is contained in:
xiaomlove
2022-03-08 15:08:56 +08:00
parent a56891132d
commit 718a57539d
67 changed files with 1149 additions and 104 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Console\Commands;
use App\Models\User;
use App\Repositories\TagRepository;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Laravel\Sanctum\PersonalAccessToken;
class MigrateTorrentTag extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'torrent:migrate_tags';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Migrate exits torrent tags to new structure';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$rep = new TagRepository();
$result = $rep->migrateTorrentTag();
$log = sprintf('[%s], %s, result: %s, query: %s', REQUEST_ID, __METHOD__, var_export($result, true), last_query());
$this->info($log);
do_log($log);
return 0;
}
}

View File

@@ -2,6 +2,7 @@
namespace App\Console\Commands;
use App\Http\Resources\TagResource;
use App\Models\Attendance;
use App\Models\Exam;
use App\Models\ExamProgress;
@@ -10,6 +11,7 @@ use App\Models\HitAndRun;
use App\Models\Medal;
use App\Models\SearchBox;
use App\Models\Snatch;
use App\Models\Tag;
use App\Models\User;
use App\Repositories\AgentAllowRepository;
use App\Repositories\AttendanceRepository;
@@ -60,10 +62,10 @@ class Test extends Command
*/
public function handle()
{
$peerId = '-TR3000-uff7q3z5126z';
$agent = 'Transmission/3.00';
$rep = new AgentAllowRepository();
$r = $rep->checkClient($peerId, $agent, true);
$r = Tag::query()->paginate();
$resource = TagResource::collection($r);
dd($resource->response()->getData(true));
echo $r->updated_at;
}
}