Wednesday, 8 March 2017

yii2 limit offset

limit()


$model = User::find()->limit(10)->all();

 
$model = User::find()->where('userid > 1 and isactive=1')->limit(2)->all(); 

offset()

$model = User::find()->limit(5)->offset(10)->all();

No comments:

Post a Comment