TypeRocket / core

TypeRocket core source files where all the magic lives.
https://typerocket.com
36 stars 21 forks source link

Raw sql for order by (model query) #76

Closed tomislav13 closed 3 years ago

tomislav13 commented 4 years ago

Regards, I have a model where I need to pull 15 random rows, but this didn't work: ->orderBy(NULL, 'RAND()') // params are only $column and $direction But I found the solution/hack with this: ->appendRawWhere(null, 'ORDER BY RAND()') Is there some other way to add custom sql?

kevindees commented 3 years ago

Hey @tomislav13

This feature has been added.

Thanks, Kevin