In SQL I could able to select records that their ids dividable by 4:
SELECT id FROM table_name WHERE id%4 = 0;
I tried to do that in Yii2 active record but it failed with error:
$model = Verses::find()->where(['%4','id',0])->orderBy('id')->all();
Is there any way or documentation hint about this?
$model = Verses::find()->where(['=','id%4',0])->orderBy('id')->all();- Serghei LeonencoActiveRecordonly? - Basheer Kharotihaving()to filter results, Something like this:$model = Verses::find()->orderBy('id')->groupBy('id')->having([['id % 4' => 0]])->all();- Serghei Leonenco['=','id%4',0]but with error too. - SaidbakR