mirror of
https://github.com/flarum/framework.git
synced 2025-01-06 02:23:36 +08:00
Remove facade usage
This commit is contained in:
parent
d27526431c
commit
ce5ae10b21
|
@ -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\')'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user