mirror of
https://github.com/flarum/core.git
synced 2025-08-03 15:07:53 +02:00
Remove facade usage
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
<?php namespace Flarum\Core\Seeders;
|
<?php namespace Flarum\Core\Seeders;
|
||||||
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use DB;
|
|
||||||
use Flarum\Core\Models\CommentPost;
|
use Flarum\Core\Models\CommentPost;
|
||||||
use Flarum\Core\Models\Discussion;
|
use Flarum\Core\Models\Discussion;
|
||||||
use Flarum\Core\Models\DiscussionRenamedPost;
|
use Flarum\Core\Models\DiscussionRenamedPost;
|
||||||
@@ -126,10 +125,10 @@ class DiscussionsTableSeeder extends Seeder
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update user post and discussion counts.
|
// Update user post and discussion counts.
|
||||||
$prefix = DB::getTablePrefix();
|
$prefix = app('db')->getTablePrefix();
|
||||||
DB::table('users')->update([
|
app('db')->table('users')->update([
|
||||||
'discussions_count' => DB::raw('(SELECT COUNT(id) FROM '.$prefix.'discussions WHERE start_user_id = '.$prefix.'users.id)'),
|
'discussions_count' => app('db')->raw('(SELECT COUNT(id) FROM '.$prefix.'discussions WHERE start_user_id = '.$prefix.'users.id)'),
|
||||||
'comments_count' => DB::raw('(SELECT COUNT(id) FROM '.$prefix.'posts WHERE user_id = '.$prefix.'users.id and type = \'comment\')'),
|
'comments_count' => app('db')->raw('(SELECT COUNT(id) FROM '.$prefix.'posts WHERE user_id = '.$prefix.'users.id and type = \'comment\')'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user