I have this code to find a user from db which status is active and role is user
public static function findByUsername($username) { return static::find([\'userna
I want to offer another solution, it's more elegant for me. I usually use this approach since Yii 1 when i need check not equal operation.
$models = Book::find()->where('id != :id and type != :type', ['id'=>1, 'type'=>1])->all();