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
Ok, i've done by this way:
public static function findByUsername($username) { $sql="select * from tbl_user where username=:uname and status=:st and role != 'user'"; return static::findBySql($sql,[":uname"=>$username,":st"=>static::STATUS_ACTIVE])->one(); }