Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug addSort #609

Open
inZaneX opened this issue Nov 10, 2023 · 0 comments
Open

Bug addSort #609

inZaneX opened this issue Nov 10, 2023 · 0 comments

Comments

@inZaneX
Copy link

inZaneX commented Nov 10, 2023

https://github.com/MedicOneSystems/livewire-datatables/blob/cfb4d800e39df96202564fe947e6046e6b8c52c1/src/Http/Livewire/LivewireDatatable.php#L1607C54-L1607C56

it should look like this:

$this->query->orderBy(DB::raw('FIELD('.$this->query->from.'.id,' . implode(',', $this->pinnedRecords) . ')'), 'DESC');

Otherwise it could stop working if you use more relations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant