7
你好我的代碼Yii的findAllByAttributes LIMIT
$allLogins = IpAddressLogin::model()->findAllByAttributes(
array(
'user_id' => Yii::app()->user->id,
'type' => 'user'
),
array(
'order' => 'date desc',
'limit' => '15, 10',
));
我想從15號記錄10條記錄。但它只給了我最後的15條記錄。
它只解析'限制'中的第一個數字(15)。如何在findAllByAttributes中設置LIMIT 15,10?
你需要'limit'和'offset',在這裏檢查:http://stackoverflow.com/a/12943125/133408 – 2013-11-04 08:49:46