How to query data within the TP5 model?

how does a method such as inside the User model get the data? Is it wrong to write like this?

public static function getuid($value){
         return $this->where("username",$value)->find();
}
Mar.10,2021

you are using a static method, you cannot use $this, use self

Menu