开发者

Shuffled result in ORM query

开发者 https://www.devze.com 2023-03-09 13:27 出处:网络
Let say开发者_开发百科 that I have a table of some data. I want am running a query using ORM in Kohana 2.3.

Let say开发者_开发百科 that I have a table of some data. I want am running a query using ORM in Kohana 2.3.

ORM::factory('somemodel')->find_all(); // ordered by $sort

I want to modify that query to return shuffled results.


Use rand.

Here is the example for it

http://docs.kohanaphp.com/libraries/database/builder#orderby

0

精彩评论

暂无评论...
验证码 换一张
取 消