【发布时间】:2013-11-04 08:43:32
【问题描述】:
你好,我有代码
$allLogins = IpAddressLogin::model()->findAllByAttributes(
array(
'user_id' => Yii::app()->user->id,
'type' => 'user'
),
array(
'order' => 'date desc',
'limit' => '15, 10',
));
我想从第 15 条记录中获取 10 条记录。但它只给了我最后 15 条记录。
它只解析'limit'中的第一个数字(15)。如何在 findAllByAttributes 中设置 LIMIT 15、10?
【问题讨论】:
-
你需要
limit和offset,查看这里:stackoverflow.com/a/12943125/133408
标签: yii