$model = User::find()
->where(['LIKE', 'username', 'admin'])
->all();
//OR
$model = User::find()->where('username LIKE :query')->addParams([':query'=>'%admin%'])
->all();
->where(['LIKE', 'username', 'admin'])
->all();
//OR
$model = User::find()->where('username LIKE :query')->addParams([':query'=>'%admin%'])
->all();
$model = User::find()->where(['NOT LIKE', 'username', 'admin'])->all();
yii2 LIKE Condition in query
No comments:
Post a Comment