1
0
mirror of https://github.com/flarum/core.git synced 2025-07-16 14:26:25 +02:00

Fix column names

This commit is contained in:
Toby Zerner
2018-07-21 15:24:51 +09:30
parent fb6b2d05b1
commit 93b9513df2
3 changed files with 4 additions and 4 deletions

View File

@@ -380,7 +380,7 @@ class Discussion extends AbstractModel
*/ */
public function lastUser() public function lastUser()
{ {
return $this->belongsTo(User::class, 'last_user_id'); return $this->belongsTo(User::class, 'last_posted_user_id');
} }
/** /**

View File

@@ -34,7 +34,7 @@ class NotificationRepository
->whereIn('type', $user->getAlertableNotificationTypes()) ->whereIn('type', $user->getAlertableNotificationTypes())
->whereNull('deleted_at') ->whereNull('deleted_at')
->groupBy('type', 'subject_id') ->groupBy('type', 'subject_id')
->orderByRaw('MAX(time) DESC') ->orderByRaw('MAX(created_at) DESC')
->skip($offset) ->skip($offset)
->take($limit); ->take($limit);

View File

@@ -136,8 +136,8 @@ class PostRepository
$query = Discussion::find($discussionId) $query = Discussion::find($discussionId)
->posts() ->posts()
->whereVisibleTo($actor) ->whereVisibleTo($actor)
->where('time', '<', function ($query) use ($discussionId, $number) { ->where('created_at', '<', function ($query) use ($discussionId, $number) {
$query->select('time') $query->select('created_at')
->from('posts') ->from('posts')
->where('discussion_id', $discussionId) ->where('discussion_id', $discussionId)
->whereNotNull('number') ->whereNotNull('number')