mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 06:03:39 +08:00
Support table custom table prefix
Laravel automatically adds a table prefix to any table names, so we need to wrap our aliased table in DB::raw.
This commit is contained in:
parent
4d164d2e55
commit
94076e5b9c
|
@ -26,9 +26,9 @@ class NotificationRepository
|
|||
->skip($offset)
|
||||
->take($limit);
|
||||
|
||||
return Notification::select('notifications.*', 'p.unread_count')
|
||||
return Notification::select('notifications.*', app('flarum.db')->raw('p.unread_count'))
|
||||
->mergeBindings($primaries->getQuery())
|
||||
->join(app('flarum.db')->raw('('.$primaries->toSql().') p'), 'notifications.id', '=', 'p.id')
|
||||
->join(app('flarum.db')->raw('('.$primaries->toSql().') p'), 'notifications.id', '=', app('flarum.db')->raw('p.id'))
|
||||
->latest('time')
|
||||
->get();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user