Skip to content

Commit 60dfaf2

Browse files
committed
Merge branch 'release/0.1.12'
2 parents bcc2d5d + cb1853a commit 60dfaf2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Field/PostObject.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ public function process($fieldName)
2626
$connection = $this->post->getConnectionName();
2727

2828
if (is_array($postId)) {
29-
$this->object = Post::on($connection)->whereIn('ID', $postId)->get();
29+
$this->object = Post::on($connection)->whereIn('ID', $postId)->get()->sortBy(function ($item) use ($postId) {
30+
return array_search($item->getKey(), $postId);
31+
});
3032
} else {
3133
$this->object = Post::on($connection)->find($postId);
3234
}

0 commit comments

Comments
 (0)