Closed Bazowsky closed 8 months ago
Hi @Bazowsky can you pls give some context on what this PR is fixing
Before:
$db->select('users')->orderBy('registrationDate', 'asc');
(It`s ok) [query] => SELECT * FROM users ORDER BY registrationDate ASC
On first chain fails
$db->select('users')->orderBy('registrationDate', 'asc')->orderBy('score', 'desc');
[query] => SELECT * FROM users ORDER BY score DESC ASC
Second
$db->select('users')->orderBy('registrationDate', 'asc')->orderBy('score', 'desc')->orderBy('matches', 'desc');
[query] => SELECT * FROM users ORDER BY matches DESC DESC ASC
After:
$db->select('users')->orderBy('registrationDate', 'asc')
[query] => SELECT * FROM users ORDER BY registrationDate ASC
$db->select('users')->orderBy('registrationDate', 'asc')->orderBy('score', 'desc')
[query] => SELECT * FROM users ORDER BY score DESC, registrationDate ASC
$db->select('users')->orderBy('registrationDate', 'asc')->orderBy('score', 'desc')->orderBy('matches', 'desc')
[query] => SELECT * FROM users ORDER BY matches DESC, score DESC, registrationDate ASC
And so on...
Thanks for this fix ❤️
Description
Related Issue