mirror of
https://github.com/flarum/core.git
synced 2025-07-16 14:26:25 +02:00
Fix notification query with DB prefix
This was fixed in https://github.com/laravel/framework/pull/28400.
See commit 7f1048352d
.
This commit is contained in:
@@ -11,7 +11,6 @@ namespace Flarum\Notification;
|
|||||||
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Flarum\User\User;
|
use Flarum\User\User;
|
||||||
use Illuminate\Database\Query\Expression;
|
|
||||||
|
|
||||||
class NotificationRepository
|
class NotificationRepository
|
||||||
{
|
{
|
||||||
@@ -36,11 +35,8 @@ class NotificationRepository
|
|||||||
->skip($offset)
|
->skip($offset)
|
||||||
->take($limit);
|
->take($limit);
|
||||||
|
|
||||||
return Notification::select('notifications.*')
|
return Notification::select('notifications.*', 'p.unread_count')
|
||||||
->selectRaw('p.unread_count')
|
->joinSub($primaries, 'p', 'notifications.id', '=', 'p.id')
|
||||||
// Expression is necessary until Laravel 5.8.
|
|
||||||
// See https://github.com/laravel/framework/pull/28400
|
|
||||||
->joinSub($primaries, 'p', 'notifications.id', '=', new Expression('p.id'))
|
|
||||||
->latest()
|
->latest()
|
||||||
->get();
|
->get();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user