gpt4 book ai didi

cakephp-1.3 - 如何从模型中返回单个随机行?

转载 作者:行者123 更新时间:2023-12-01 23:08:54 25 4
gpt4 key购买 nike

尝试从模型中获取单个随机行。这是我从网上提取的:

$this->Testimonial->findAll(null,null,'rand()',1,null,null);

很遗憾 findAll 在 cakephp 1.3 中不再存在

最佳答案

$this->Quote->find('first', array('order' => array('rand()')))

关于cakephp-1.3 - 如何从模型中返回单个随机行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5269655/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com