mirror of
https://github.com/flarum/framework.git
synced 2025-02-01 01:51:45 +08:00
Don't imply order on posts relationship
This commit is contained in:
parent
ebd22d22f5
commit
0edfeb5031
|
@ -54,7 +54,7 @@ class DiscussionSerializer extends DiscussionBasicSerializer
|
||||||
*/
|
*/
|
||||||
public function linkPosts(Discussion $discussion)
|
public function linkPosts(Discussion $discussion)
|
||||||
{
|
{
|
||||||
return (new PostBasicSerializer)->collection($discussion->posts()->whereCanView()->ids());
|
return (new PostBasicSerializer)->collection($discussion->posts()->whereCanView()->orderBy('time', 'asc')->ids());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -106,7 +106,7 @@ class Discussion extends Entity
|
||||||
|
|
||||||
public function posts()
|
public function posts()
|
||||||
{
|
{
|
||||||
return $this->hasMany('Flarum\Core\Posts\Post')->orderBy('time', 'asc');
|
return $this->hasMany('Flarum\Core\Posts\Post');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function comments()
|
public function comments()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user