Skip to content

Commit

Permalink
fix issue of not cleare table of order column
Browse files Browse the repository at this point in the history
  • Loading branch information
Mh-Asmi committed Oct 29, 2024
1 parent 55e99f1 commit 52ffd19
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,13 @@ public function paginate(
array $with = []
): LengthAwarePaginator {
$fields = $this->addPostsTableNamePrefix($fields);
// add the order field if not found
if (!in_array('posts.'.$paging->getOrderBy(), $fields)) {
$fields[] = 'posts.'.$paging->getOrderBy();
}
$query = Post::take($paging->getLimit())
//->skip($paging->getSkip())
->orderBy($paging->getOrderBy(), $paging->getOrder());
->orderBy('posts.'.$paging->getOrderBy(), $paging->getOrder());

$query = $this->setSearchCondition($search_fields, $query);
$query = $this->setGuestConditions($query);
Expand Down

0 comments on commit 52ffd19

Please sign in to comment.