From ce5ae10b211c7e862b5999b12fbdf244daabfa0c Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 9 Jun 2015 00:06:08 +0200 Subject: [PATCH] Remove facade usage --- .../core/src/Core/Seeders/DiscussionsTableSeeder.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/framework/core/src/Core/Seeders/DiscussionsTableSeeder.php b/framework/core/src/Core/Seeders/DiscussionsTableSeeder.php index e26a8b738..c7d58a5b9 100644 --- a/framework/core/src/Core/Seeders/DiscussionsTableSeeder.php +++ b/framework/core/src/Core/Seeders/DiscussionsTableSeeder.php @@ -1,7 +1,6 @@ update([ - 'discussions_count' => 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\')'), + $prefix = app('db')->getTablePrefix(); + app('db')->table('users')->update([ + 'discussions_count' => app('db')->raw('(SELECT COUNT(id) FROM '.$prefix.'discussions WHERE start_user_id = '.$prefix.'users.id)'), + 'comments_count' => app('db')->raw('(SELECT COUNT(id) FROM '.$prefix.'posts WHERE user_id = '.$prefix.'users.id and type = \'comment\')'), ]); } }