@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | public function handle($command) |
12 | 12 | { |
13 | 13 | $command->info('Migrating Contest...'); |
14 | - $this->table('contest')->orderBy('contest_id', 'asc')->chunk(100, function ($objects) { |
|
15 | - $objects->map(function ($object) { |
|
14 | + $this->table('contest')->orderBy('contest_id', 'asc')->chunk(100, function($objects) { |
|
15 | + $objects->map(function($object) { |
|
16 | 16 | $this->transform($object); |
17 | 17 | }); |
18 | 18 | }); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $perm = 'c'.$contest->id; |
65 | 65 | $perms = $this->table('privilege')->where('rightstr', $perm)->distinct('user_id')->get(); |
66 | 66 | |
67 | - $perms->map(function ($perm) use ($contest) { |
|
67 | + $perms->map(function($perm) use ($contest) { |
|
68 | 68 | /** @var User $user */ |
69 | 69 | $user = app(UserService::class)->findByName($perm->user_id); |
70 | 70 | $contest->users()->attach($user); |
@@ -10,8 +10,8 @@ |
||
10 | 10 | public function handle($command) |
11 | 11 | { |
12 | 12 | $command->info('Migrating Articles...'); |
13 | - $this->table('news')->orderBy('news_id', 'asc')->chunk(100, function ($objects) { |
|
14 | - $objects->map(function ($object) { |
|
13 | + $this->table('news')->orderBy('news_id', 'asc')->chunk(100, function($objects) { |
|
14 | + $objects->map(function($object) { |
|
15 | 15 | $this->transformArticle($object); |
16 | 16 | }); |
17 | 17 | }); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | public function handle($command) |
10 | 10 | { |
11 | 11 | $command->info('Migrating Users...'); |
12 | - $this->table('users')->orderBy('reg_time', 'asc')->chunk(100, function ($objects) { |
|
12 | + $this->table('users')->orderBy('reg_time', 'asc')->chunk(100, function($objects) { |
|
13 | 13 | foreach ($objects as $object) { |
14 | 14 | $this->transform($object); |
15 | 15 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | public function handle($command) |
16 | 16 | { |
17 | 17 | $command->info('Migrating Login Logs...'); |
18 | - User::chunk(100, function ($users) { |
|
18 | + User::chunk(100, function($users) { |
|
19 | 19 | foreach ($users as $user) { |
20 | 20 | $this->processUser($user); |
21 | 21 | } |
@@ -44,15 +44,15 @@ |
||
44 | 44 | { |
45 | 45 | $now = Carbon::now()->subDays($days)->setTime(0, 0); |
46 | 46 | $logs = $this->getTable()->where('user_id', $user->username) |
47 | - ->where('time', $now, '>') |
|
48 | - ->orderBy('time', 'asc') |
|
49 | - ->get(); |
|
47 | + ->where('time', $now, '>') |
|
48 | + ->orderBy('time', 'asc') |
|
49 | + ->get(); |
|
50 | 50 | |
51 | 51 | if ($logs->count() < 10) { |
52 | 52 | $logs = $this->getTable()->where('user_id', $user->username) |
53 | - ->limit(10) |
|
54 | - ->orderBy('time', 'desc') |
|
55 | - ->get(); |
|
53 | + ->limit(10) |
|
54 | + ->orderBy('time', 'desc') |
|
55 | + ->get(); |
|
56 | 56 | $logs = $logs->reverse(); |
57 | 57 | } |
58 | 58 |
@@ -13,25 +13,25 @@ |
||
13 | 13 | public function handle($command) |
14 | 14 | { |
15 | 15 | $command->info('Migrating Solutions...'); |
16 | - $this->table('solution')->orderBy('solution_id', 'asc')->chunk(100, function ($objects) { |
|
16 | + $this->table('solution')->orderBy('solution_id', 'asc')->chunk(100, function($objects) { |
|
17 | 17 | foreach ($objects as $object) { |
18 | 18 | $this->transformSolution($object); |
19 | 19 | } |
20 | 20 | }); |
21 | 21 | $command->info('Migrating Runtime Info...'); |
22 | - $this->table('runtimeinfo')->orderBy('solution_id', 'asc')->chunk(100, function ($objects) { |
|
22 | + $this->table('runtimeinfo')->orderBy('solution_id', 'asc')->chunk(100, function($objects) { |
|
23 | 23 | foreach ($objects as $object) { |
24 | 24 | $this->transformRuntimeInfo($object); |
25 | 25 | } |
26 | 26 | }); |
27 | 27 | $command->info('Migrating Compile Info...'); |
28 | - $this->table('compileinfo')->orderBy('solution_id', 'asc')->chunk(100, function ($objects) { |
|
28 | + $this->table('compileinfo')->orderBy('solution_id', 'asc')->chunk(100, function($objects) { |
|
29 | 29 | foreach ($objects as $object) { |
30 | 30 | $this->transformCompileInfo($object); |
31 | 31 | } |
32 | 32 | }); |
33 | 33 | $command->info('Migrating Source Code...'); |
34 | - $this->table('source_code')->orderBy('solution_id', 'asc')->chunk(100, function ($objects) { |
|
34 | + $this->table('source_code')->orderBy('solution_id', 'asc')->chunk(100, function($objects) { |
|
35 | 35 | foreach ($objects as $object) { |
36 | 36 | $this->transformSource($object); |
37 | 37 | } |
@@ -9,8 +9,8 @@ |
||
9 | 9 | public function handle($command) |
10 | 10 | { |
11 | 11 | $command->info('Migrating Problems...'); |
12 | - $this->table('problem')->orderBy('problem_id', 'asc')->chunk(100, function ($objects) { |
|
13 | - $objects->map(function ($object) { |
|
12 | + $this->table('problem')->orderBy('problem_id', 'asc')->chunk(100, function($objects) { |
|
13 | + $objects->map(function($object) { |
|
14 | 14 | $this->transform($object); |
15 | 15 | }); |
16 | 16 | }); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | public function register() |
22 | 22 | { |
23 | - $this->app->bind('hash', function () { |
|
23 | + $this->app->bind('hash', function() { |
|
24 | 24 | return new Hasher(); |
25 | 25 | }); |
26 | 26 | } |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | protected function mapApiRoutes() |
41 | 41 | { |
42 | 42 | Route::prefix('judge') |
43 | - // ->middleware('judge') |
|
44 | - ->namespace($this->namespace) |
|
45 | - ->group(base_path('routes/judge.php')); |
|
43 | + // ->middleware('judge') |
|
44 | + ->namespace($this->namespace) |
|
45 | + ->group(base_path('routes/judge.php')); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | protected function mapWebRoutes() |
56 | 56 | { |
57 | 57 | Route::middleware('web') |
58 | - ->namespace($this->namespace) |
|
59 | - ->group(base_path('routes/web.php')); |
|
58 | + ->namespace($this->namespace) |
|
59 | + ->group(base_path('routes/web.php')); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | private function mapAdminRoutes() |
63 | 63 | { |
64 | 64 | Route::prefix('admin') |
65 | - ->middleware('admin') |
|
66 | - ->namespace($this->namespace) |
|
67 | - ->group(base_path('routes/admin.php')); |
|
65 | + ->middleware('admin') |
|
66 | + ->namespace($this->namespace) |
|
67 | + ->group(base_path('routes/admin.php')); |
|
68 | 68 | } |
69 | 69 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | public function handle() |
16 | 16 | { |
17 | 17 | $id = $this->argument('id'); |
18 | - app()->singleton(SolutionServer::class, function () { |
|
18 | + app()->singleton(SolutionServer::class, function() { |
|
19 | 19 | return new SolutionServer(); |
20 | 20 | }); |
21 | 21 | if (strpos($id, '-') !== false) { |